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!