How to create a worldmap with color gradient ?

8 ビュー (過去 30 日間)
RMS714
RMS714 2017 年 6 月 2 日
回答済み: Shruti Shivaramakrishnan 2017 年 6 月 12 日
Hello all,
I use the function borders, and i try to create a worldmap but i can only put basic color on the map. I would like have a color gradient that evolve with a value associated to the country.
This is my code :
for i = 1 : length(unique(SF3.data(:,3)));
for p = 1 : 204;
borders(SF3.meta_info{5, 1}{1+p,1},'facecolor',COLOR{SF4(p,3)});
end;
end;
SF3.meta_info{5, 1}{1+p,1} : this is my country name COLOR{SF4(p,3)} : color associated to the country.
Perhaps that a function named ' colorbar' may help me but i don't know how to use it in this case.
Thank you for your answers

回答 (1 件)

Shruti Shivaramakrishnan
Shruti Shivaramakrishnan 2017 年 6 月 12 日
Hello Thomas, 
I believe that the "contourcmap" function might be helpful in this case: https://www.mathworks.com/help/map/ref/contourcmap.html#bukujsg
Also, if you are looking at individual patches, the "patchesm" function might be helpful: https://www.mathworks.com/help/map/ref/patchesm.html
Furthermore, if you would like to work with worldmaps, the "geoshow" function could be useful: https://www.mathworks.com/help/map/ref/geoshow.html
The above documentation links contain examples regarding how to create a worldmap with different color settings and includes using different types of options as well depending on the use case. 
I have also found a file-exchange submission that may help: https://www.mathworks.com/matlabcentral/fileexchange/28943-color-palette-tables---cpt--for-matlab
Please note that file-exchange submissions would be considered third-party submissions.

カテゴリ

Help Center および File ExchangeMap Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by