Home > custom > grid_tools > plot_dem.m

plot_dem

PURPOSE ^

PURPOSE: plot DEM as a map

SYNOPSIS ^

function plot_dem(dem,xcord,ycord,labels,bw)

DESCRIPTION ^

 PURPOSE: plot DEM as a map
 Usage: plot_dem(dem,xcord,ycord,labels,bw)
 where dem is the input DEM, xcord/ycord are the x and y coordinate
 vectors, labels is a cell containing title, x and y label
 {'Title','xaxis,'yaxis'} and bw is a flag to plot DEM using grayscale

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function plot_dem(dem,xcord,ycord,labels,bw)
0002 % PURPOSE: plot DEM as a map
0003 % Usage: plot_dem(dem,xcord,ycord,labels,bw)
0004 % where dem is the input DEM, xcord/ycord are the x and y coordinate
0005 % vectors, labels is a cell containing title, x and y label
0006 % {'Title','xaxis,'yaxis'} and bw is a flag to plot DEM using grayscale
0007 
0008 figure, imagesc(xcord,ycord,dem);
0009 %set(gca,'ydir','normal')
0010 cmap=[0.1062,0.2552,0.632;0.4014,0.737,0.2071;0.3471,0.6826,0.1916;0.2927,0.6282,0.1762;0.2384,0.5738,0.1607;0.1841,0.5194,0.1452;0.1297,0.465,0.1297;0.2343,0.5043,0.1402;0.3388,0.5435,0.1506;0.4434,0.5828,0.161;0.5479,0.622,0.1714;0.6525,0.6613,0.1819;0.757,0.7005,0.1923;0.695,0.6352,0.1946;0.633,0.5699,0.1969;0.571,0.5046,0.1992;0.509,0.4393,0.2015;0.447,0.374,0.2038;0.4223,0.3534,0.1927;0.3975,0.3327,0.1815;0.3728,0.3121,0.1703;0.3481,0.2914,0.1591;0.3234,0.2707,0.1479;0.2986,0.2501,0.1368;0.2739,0.2294,0.1256;0.2492,0.2087,0.1144;0.2245,0.1881,0.1032;0.1997,0.1674,0.092;0.175,0.1468,0.0808;0.2136,0.1794,0.0996;0.2522,0.212,0.1183;0.2908,0.2447,0.137;0.3294,0.2773,0.1557;0.368,0.3099,0.1744;0.3894,0.3397,0.2235;0.4109,0.3694,0.2726;0.4323,0.3991,0.3217;0.4537,0.4288,0.3708;0.4751,0.4586,0.4198;0.4966,0.4883,0.4689;0.518,0.518,0.518;0.5402,0.5402,0.5402;0.5624,0.5624,0.5624;0.5846,0.5846,0.5846;0.6068,0.6068,0.6068;0.629,0.629,0.629;0.6512,0.6512,0.6512;0.6734,0.6734,0.6734;0.6956,0.6956,0.6956;0.7178,0.7178,0.7178;0.74,0.74,0.74;0.7622,0.7622,0.7622;0.7844,0.7844,0.7844;0.8066,0.8066,0.8066;0.8288,0.8288,0.8288;0.851,0.851,0.851;0.8696,0.8696,0.8696;0.8882,0.8882,0.8882;0.9069,0.9069,0.9069;0.9255,0.9255,0.9255;0.9441,0.9441,0.9441;0.9628,0.9628,0.9628;0.9814,0.9814,0.9814;1,1,1;];
0011 if exist('bw','var')
0012     if bw==1
0013         cmap=[1,1,1;0.7529,0.7529,0.7529;0.7194,0.7194,0.7194;0.6858,0.6858,0.6858;0.6523,0.6523,0.6523;0.6187,0.6187,0.6187;0.5851,0.5851,0.5851;0.5516,0.5516,0.5516;0.518,0.518,0.518;0.4907,0.4907,0.4907;0.4635,0.4635,0.4635;0.4362,0.4362,0.4362;0.4089,0.4089,0.4089;0.3817,0.3817,0.3817;0.3544,0.3544,0.3544;0.3272,0.3272,0.3272;0.2999,0.2999,0.2999;0.2726,0.2726,0.2726;0.2454,0.2454,0.2454;0.2181,0.2181,0.2181;0.1908,0.1908,0.1908;0.1636,0.1636,0.1636;0.1363,0.1363,0.1363;0.1091,0.1091,0.1091;0.0818,0.0818,0.0818;0.0545,0.0545,0.0545;0.0273,0.0273,0.0273;0,0,0;0.0677,0.0677,0.0677;0.1354,0.1354,0.1354;0.2031,0.2031,0.2031;0.2708,0.2708,0.2708;0.3385,0.3385,0.3385;0.4062,0.4062,0.4062;0.474,0.474,0.474;0.5417,0.5417,0.5417;0.6094,0.6094,0.6094;0.6771,0.6771,0.6771;0.7448,0.7448,0.7448;0.8125,0.8125,0.8125;0.8203,0.8203,0.8203;0.8281,0.8281,0.8281;0.8359,0.8359,0.8359;0.8438,0.8438,0.8438;0.8516,0.8516,0.8516;0.8594,0.8594,0.8594;0.8672,0.8672,0.8672;0.875,0.875,0.875;0.8828,0.8828,0.8828;0.8906,0.8906,0.8906;0.8984,0.8984,0.8984;0.9062,0.9062,0.9062;0.9141,0.9141,0.9141;0.9219,0.9219,0.9219;0.9297,0.9297,0.9297;0.9375,0.9375,0.9375;0.9453,0.9453,0.9453;0.9531,0.9531,0.9531;0.9609,0.9609,0.9609;0.9688,0.9688,0.9688;0.9766,0.9766,0.9766;0.9844,0.9844,0.9844;0.9922,0.9922,0.9922;1,1,1;];
0014     end
0015 end
0016 colormap(cmap);
0017 
0018 if ~exist('labels','var')
0019     labels={'','',''};
0020 end
0021 title(labels(1));
0022 xlabel(labels(2));
0023 ylabel(labels(3));
0024 colormapeditor;
0025 
0026 
0027

Generated on Tue 24-Feb-2009 19:14:50 by m2html © 2003