contourm plot on the map axes shrinks

3 ビュー (過去 30 日間)
Jingwan
Jingwan 2014 年 6 月 12 日
回答済み: Eirik Mikal Samuelsen 2017 年 3 月 23 日
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
Eirik Mikal Samuelsen 2017 年 3 月 23 日
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 Center および File ExchangeGeographic Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by