www.gusucode.com > map 案例源码 matlab代码程序 > map/DisplayGridAndContourLinesExample.m

    %% Display Grid and Contour Lines 
% 
%%
% Read the terrain data files for Mount Washington and Mount Dartmouth.

% Copyright 2015 The MathWorks, Inc.

[Z_W, R_W] = arcgridread('MtWashington-ft.grd');
[Z_D, R_D] = arcgridread('MountDartmouth-ft.grd');
%%
% Display the terrain data as a surface in the z == 0 plane, so that
% overlying contour lines and labels are visible.
figure
hold on
mapshow(zeros(size(Z_W)),R_W,'CData',Z_W,'DisplayType','surface')
mapshow(zeros(size(Z_D)),R_D,'CData',Z_D,'DisplayType','surface')
axis equal
%%
% Overlay black contour lines and labels.
cW = mapshow(Z_W, R_W, 'DisplayType', 'contour', ...
   'LineColor','black', 'ShowText', 'on');
cD = mapshow(Z_D, R_D, 'DisplayType', 'contour', ...
   'LineColor','black', 'ShowText', 'on');
%%
% Set the colormap appropriate to terrain elevation.
demcmap(Z_W)