using worldmap in 0 to 360 longitude

조회 수: 6 (최근 30일)
Pusks
Pusks 2011년 6월 16일
댓글: Sachini Pathirana 2020년 4월 17일
I am trying to plot rainfall data as a contour plot over a worldmap. The problem is that the data is in 0 360 longitude and the world map comes out half blank because that is in the 180 -180 longitude system. Changing my longitude to this system using longi=mod((longi+180),360)-180; is not working as the contours stretch out from the leftmost end to the rightmost end across the map. To avoid this I will need to rearrange the data in the matrices which is resource intensive. Is there a way I can simply plot the world map into the 360 degree system. I am using R2008b and the worldmap function is geoshow('landareas.shp', 'FaceColor', 'None')
Thanks PK

채택된 답변

Kelly Kearney
Kelly Kearney 2011년 6월 16일
Instead of using worldmap, use axesm to manually create an axis with the limits you want:
% Some fake data
data = peaks(50);
lat = linspace(-90,90,50);
lon = linspace(0, 360, 50);
% Plot the map
axesm('robinson', 'maplonlimit', [0 360], 'frame', 'on');
geoshow('landareas.shp', 'facecolor', 'none');
contourm(lat, lon, data);
  댓글 수: 3
balaji SENAPATI
balaji SENAPATI 2020년 1월 20일
편집: balaji SENAPATI 2020년 1월 20일
why is it not working for pcolor?
Sachini Pathirana
Sachini Pathirana 2020년 4월 17일
How to do this when plotting the data with pcolor? Been trying to do so. But the data just gets plotted over the worldmap and also doesn't seem to be in the proper proportion.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Rob Comer
Rob Comer 2011년 6월 16일
Another approach is to follow
worldmap world
with
setm(gca,'Origin',[0 180])
in order to preserve the other worldmap settings.

카테고리

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