필터 지우기
필터 지우기

Worldmap plot with data

조회 수: 6 (최근 30일)
SOFIA DARMARAKI
SOFIA DARMARAKI 2015년 6월 17일
댓글: SOFIA DARMARAKI 2015년 6월 19일
Hello!!I am a very beginner in Matlab and I am trying to make the contour of temperature anomaly data that are in a 4D matrix(longitude,latitude,month,year) with a world map on the background. The problem is that the longitude of these data goes from 0-360 and matlab world maps usually go from -180 to 180. Is there an effective way to make the coastline going from 0-360, using the latitude and longitude data that i have and not the default ones??Im using a 2014b Matlab. I was also trying to find a way to do that with the Map_M toolbox of Matlab but i could not change it.Is there maybe a way through it??Thank you in advance!

답변 (1개)

Andrew Schenk
Andrew Schenk 2015년 6월 18일
편집: Andrew Schenk 2015년 6월 18일
The code below will create a map axes, set the longitude limits to 0 to 360 and plot the coastlines on the map. Note that the Meridian Labels will now display as 0 to 360 E.
%create the map axes. See http://www.mathworks.com/help/map/the-map-frame.html
axesm('MapProjection','robinson',...
'MapLatLimit',[-90 90],'MapLonLimit',[0 360], ...
'Frame','on','Grid','on', 'MeridianLabel', 'on', 'ParallelLabel', 'on')
%load the coast data and plot. See http://www.mathworks.com/help/map/create-a-world-map.html
load coast
[latcells, loncells] = polysplit(lat, long);
numel(latcells)
plotm(lat, long)
  댓글 수: 1
SOFIA DARMARAKI
SOFIA DARMARAKI 2015년 6월 19일
Thank you very much for that answer!!It seems to work. But when i try to extract a certain area e.g Mediterranean with longitude area from -11 to 37 and latitude area from 29 to 50 i can't really have a result.I can't locate the exact pixel location of these values for longitude and latitude.

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

카테고리

Help CenterFile Exchange에서 Mapping Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by