contourm plot on the map axes shrinks

2 次查看(过去 30 天)
I have a sea level pressure data set (25 x 47 x 262 double). The first two dimensions are latitudes and longitudes. The third dimension is the time. I used the function contourm to plot the contour map of the mean of the data on the map axes using 'mercator' projection, but the plot shrunk and became unreadable. Then I realized I couldn't plot the data for some individual days (i.e. day 252) on the map axes.
But for most of the days, the contourm works.
I also tried to plot the contour map on the normal xy axes, everything worked fine.
The code I used is as follows.
clc
clear all
close all
load('slp.mat')
close all
figure(1)
set(gcf,'Color','w')
axesm('mercator','MapLatLimit',[-40, -25],'MapLonLimit',[140, 152.5])
axis off; framem on; gridm on; mlabel on; plabel on;
setm(gca, 'MLineLocation', 2,'PLineLocation',2,...
'MLabelLocation',4,'PLabelLocation',4,'LabelUnits','degrees',...
'MLabelRound',-1,'PLabelRound',-1)
% [c,h] =contourm(lat,lon,mean(slp,3));
% [c,h] =contourm(lat,lon,mean(slp(:,:,[1:251,253:end]),3));
% [c,h] =contourm(lat,lon,mean(slp(:,:,251:254),3));
[c,h] =contourm(lat,lon,slp(:,:,251));
clabelm(c,h)
figure(2)
set(gcf,'Color','w')
axesm('mercator','MapLatLimit',[-40, -25],'MapLonLimit',[140, 152.5])
axis off; framem on; gridm on; mlabel on; plabel on;
setm(gca, 'MLineLocation', 2,'PLineLocation',2,...
'MLabelLocation',4,'PLabelLocation',4,'LabelUnits','degrees',...
'MLabelRound',-1,'PLabelRound',-1)
[c,h] =contourm(lat,lon,slp(:,:,252));
clabelm(c,h)
figure(3)
contourm(lat,lon,slp(:,:,252))
xlabel('longitude');
ylabel('latitude');
I don't know what makes the contourm plot fail on some of the data.

回答(1 个)

Eirik Mikal Samuelsen
I have the same problem. Are there any answers out there?
I have applied the same code for these two plots, but due to the difference in the underlying .nc file, they are for some reason plotted differently...

类别

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