how to color the world with two color(red and green)?

5 次查看(过去 30 天)
i have the current account of every country. i want to draw a map below. the current account bigger than zero is color with green while the current account smaller than zero is colored with red. i use the world.shp to do this ,but i failed. Beside, some countries lack the data, will be color with gray。
mycode:
S = shaperead('World_Country.shp', 'UseGeoCoords',true);
maxdensity = max([S.CA]);
mindensity=min([S.CA]);
fall = flipud(autumn(numel(S)));
densityColors = makesymbolspec('Polygon', {'CA', ...
[mindensity maxdensity], 'FaceColor', fall});
geoshow(S, 'DisplayType', 'polygon', ...
'SymbolSpec', densityColors)
countries.shp file: link:https://pan.baidu.com/s/1FKVBRWr6WS4pEg18XiT_-A
pin:1111

回答(1 个)

KSSV
KSSV 2020-9-28
In the above you can specify your required color using a account as contiion.

类别

Help CenterFile Exchange 中查找有关 Blue 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by