Pcolor Map showing up blank?

9 次查看(过去 30 天)
Shayma Al Ali
Shayma Al Ali 2023-8-21
回答: Voss 2023-8-21
Hi everyone!
I'm trying to plot a map using pcolor, however the map ends up being blank. I'm not really sure what I'm doing wrong? I attached the code below, and an image of the map that my code has been creating.
My code:
%create data
lat=[-90:0.25:90];
lon=[0:0.25:359.75];
smean=rand(1440,721);
figure(121)
worldmap([-90 90], [0 360])
load coastlines
pcolor(lat,lon,smean); hold on
geoshow(coastlat,coastlon,'Color','k'); hold off
h=colorbar;
%h.Label='Difference in SWH measurement (m)';
ylabel(h,'Kw (cm hr-1','FontSize',10);
title('Climatological Mean of Kw for January')

回答(1 个)

Voss
Voss 2023-8-21
Use pcolorm
%create data
lat=[-90:0.25:90];
lon=[0:0.25:359.75];
smean=rand(1440,721);
figure(121)
worldmap([-90 90], [0 360])
load coastlines
pcolorm(lat,lon,smean); hold on
geoshow(coastlat,coastlon,'Color','k'); hold off
h=colorbar;
%h.Label='Difference in SWH measurement (m)';
ylabel(h,'Kw (cm hr-1','FontSize',10);
title('Climatological Mean of Kw for January')

类别

Help CenterFile Exchange 中查找有关 Geographic Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by