www.gusucode.com > map 案例源码 matlab代码程序 > map/DisplayWorldMapWithColormapWithCustomStepSizeExample.m
%% Display World Map with Colormap with Custom Contour Intervals % This example shows how to display a world map with a colormap in which % the colors vary at a step size of 2000. %% % Load data from MAT-files. % Copyright 2015 The MathWorks, Inc. load topo load coastlines %% % Create a raster reference object associated with the topo data set. R = georefcells(topolatlim,topolonlim,size(topo)); %% % Display the topo data set on a worldmap. figure('Color','white') worldmap(topo,R) geoshow(topo,R,'DisplayType','texturemap'); %% % Change the color map of the contours. contourcmap('summer',2000,'Colorbar','on', ... 'Location','horizontal', ... 'TitleString','Contour Intervals in Meters'); %% % Display coastlines on the map. geoshow(coastlat,coastlon,'Color', 'black')