How can I superimpose data on a map using Mapping Tool box?

When I superimpose a plot over the world map, the map gets distorted. By distorted, I mean that parts of the boarder disappear. This is the code I use:
coast = load('coast');
axesm('pcarree', 'Origin', 180,'MLabelParallel','south');
framem on; gridm on; mlabel on; plabel on; showaxes;
h = geoshow(coast.lat, coast.long,'Color','black');
hold on;
yy = linspace(-pi,pi,NumLong);
xx = linspace(-pi/2, pi/2, NumLat);
[XX, YY] = meshgrid(xx,yy);
surf(YY, XX, data);

댓글 수: 1

The map is still there and is the right size but when I plot data parts of the boundaries disappear.

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

답변 (1개)

Walter Roberson
Walter Roberson 2012년 7월 20일

0 개 추천

Before you do the surf(), set the axis XLimMode and YLimMode to 'manual'. Otherwise if the surf() wants to expand the xlimit or ylimit, it is not going to take into account the map's existence in figuring out where the bounds should be.

댓글 수: 1

Thank-you so much for your suggestion. I learned a lot of useful information by looking into this. However, this did not resolve my problem.

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

카테고리

도움말 센터File Exchange에서 Geographic Plots에 대해 자세히 알아보기

질문:

2012년 7월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by