Borrar filtros
Borrar filtros

How do I overlay worldmap outlines onto an imagesc plot?

7 visualizaciones (últimos 30 días)
Rochelle Parker
Rochelle Parker el 1 de Jul. de 2021
Respondida: Chunru el 2 de Jul. de 2021
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)

Respuestas (1)

Chunru
Chunru el 2 de Jul. de 2021
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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by