How do I overlay worldmap outlines onto an imagesc plot?
7 次查看(过去 30 天)
显示 更早的评论
I'm basically trying to get the end product to be the imagesc plot with country outlines on top of it. I'm not sure the best way to do it, but this is not working. Is there a way to do this?
% define and generate color plot
x = [-180:5:180];
y = [10 5 0 -5 -10];
d1 = rand(5,73);
d2 = floor(d1 * 5);
imagesc(x, y, d2)
colorbar
% define and generate worldmap with coastlines and hold the previous plot on
hold on
worldmap([-80 80],[-180 180])
load coast
geoshow(lat, long)
0 个评论
回答(1 个)
Chunru
2021-7-2
You can use pcolorm instead of imagesc:
% define and generate color plot
x = [-180:5:180];
y = [10 5 0 -5 -10];
d1 = rand(5,73);
d2 = floor(d1 * 5);
%imagesc(x, y, d2)
colorbar
% define and generate worldmap with coastlines and hold the previous plot on
hold on
worldmap([-80 80],[-180 180])
load coast
geoshow(lat, long)
pcolorm(y, x, d2) % lat lon, zdata
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!