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

    %% Override Symbolspec Default Rule
%  
%%
% Create a map of North America.

% Copyright 2015 The MathWorks, Inc.

figure
worldmap('na');
%%
% Read the USA high resolution data. 
states = shaperead('usastatehi', 'UseGeoCoords', true);
%%
% Create a symbolspec that sets the color of Alaska and Hawaii polygons
% red.
symspec = makesymbolspec('Polygon', ...
   {'Name', 'Alaska', 'FaceColor', 'red'}, ...
   {'Name', 'Hawaii', 'FaceColor', 'red'});
%%
% Display all the other states in blue. 
geoshow(states, 'SymbolSpec', symspec, ...
   'DefaultFaceColor', 'blue', ...
   'DefaultEdgeColor', 'black');