How to colormap a scatter plot on a map?
13 次查看(过去 30 天)
显示 更早的评论
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')
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Map Display 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!