Map projection doesn't work in Matlab2015a?

1 view (last 30 days)
Madan Kumar
Madan Kumar on 14 Jul 2022
Commented: Madan Kumar on 15 Jul 2022
Hi,
I have lat (37x73), lon(37x73) and a rainfall data(37x73). I plotted the rainfall data (attached) on map with robinson projection. However, it seems there is blanck space (I mean it is not covering the globe completely, see attched plot) although lat(-90 to 90), lon(0 to 360) and corresponding data show global coverage. I really don't know the reason. Am I doing something wrong?? Thank you so much.
my code is below
ann=importdata('rain.txt');
x1=0:5:360;%lon
y1=-90:5:90;%lat
x2=repmat(x1,37,1);
y2=repmat(y1',1,73);
%%if lon>180,west longitude
[ay,ny]=find(x2>180);x2(ay)=x2(ay)-360;
%%%%plot data on globe
landareas = shaperead('landareas.shp','UseGeoCoords',true);
axesm ('robinson', 'Frame', 'on', 'Grid', 'on');set(gca, 'color', 'none');
surfm(y2,x2,ann);geoshow(landareas,'FaceColor','none','EdgeColor',[1 1 1]);
  1 Comment
Madan Kumar
Madan Kumar on 15 Jul 2022
Solved it. longitude -180 was zero (=360-360)when substracting from 360.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!