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

2 views (last 30 days)
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

Answers (1)

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

Tags

Community Treasure Hunt

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

Start Hunting!