How to colormap a scatter plot on a map?

13 ビュー (過去 30 日間)
Kamila Turczewski
Kamila Turczewski 2019 年 8 月 6 日
回答済み: Kojiro Saito 2019 年 8 月 7 日
I'm new to the mapping toolbox on MatLab and was having a hard time finding how to use color map/mapping.
Essentially, I have the coordinates for many different watersheds in the United States and also have the annual rainfall of each watershed. I want to have a map that simply plots each point of the watershed, however I want there to be a color map that shows/distinguishes where higher rainfall amounts were. How do I assign a value to a certain scatter point?
I put a picture of simply the watersheds mapped out. But I hope to have a color bar gradiant on the side so the points have differnt colors depending on the rainfall.
Here is how I mapped it. I have another vector that holds the information in the same order of the lat/long of the rainfall.
latlim = [25 50]; lonlim = [-125 -67];
ax = usamap(latlim, lonlim);
set(ax, 'Visible', 'off')
sheds = shaperead('usastatehi','UseGeoCoords', true, 'BoundingBox', [lonlim', latlim']);
geoshow(ax, sheds, 'FaceColor', [1 1 1])
plotm(lat, long, 'o', 'MarkerFaceColor',[0 .2 .5], 'MarkerSize', 3, 'SelectionHighlight', 'on')

採用された回答

Kojiro Saito
Kojiro Saito 2019 年 8 月 7 日
You can control the color by specifying C value in scatterm or geoscatter. If you can share sample rainfall data, I can show a code in detail.

その他の回答 (0 件)

カテゴリ

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