contourm plot on the map axes shrinks
이전 댓글 표시
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
2017년 3월 23일
1 개 추천
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...
카테고리
도움말 센터 및 File Exchange에서 Map Creation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!