Move mlabel positions off axis

I have this really nice map, but I need to change two things. 1. The longitude labels are on the axis. Does anyone know how to move the labels off of the axis? 2. The latitude labels are fine, except they are not uniform. How can I change the 75 to an 80?
Here is my code.
load coastlines
figure('Color','w')%Colors the figure white.
axesm('stereo','Origin',[-90 0],'MapLatLimit',[-90 -50]);
axis off;
framem on;
gridm on;
mlabel on;
plabel on;
setm(gca,'MLabelParallel',10)
geoshow(coastlat,coastlon,'DisplayType','polygon', 'FaceColor', 'white');
I tried this to get the latitude limits, but nothing changed.
axesm('stereo','Origin',[-90 0],'MapLatLimit',[-90 -50],'FLatLimit',[-90 -60]);
I then tried this, but the 75 was still there, and 45 degrees showed up. It also made Antarctica look too small. So, I tried 60 degrees as my limit, but 75 was still there.
axesm('stereo','Origin',[-90 0],'MapLatLimit',[-90 -40]);
axesm('stereo','Origin',[-90 0],'MapLatLimit',[-90 -60]);
I figured out how to move the labels manually in figure properties, but there must be a way to move things around within the code.

 Réponse acceptée

Chad Greene
Chad Greene le 14 Août 2018

1 vote

How is this?
setm(gca,'plabellocation',10,'labelrotation','on')
The 'plabellocation' is poorly named, but it means the spacing of latitudes (p for parallels). The 10 value for 'plabellocation' places lines every 10 degrees latitude. The 'mlabelrotation' rotates the labels around the circle to keep them from conflicting with the outside of the axis.
A note: the default coastline in Matlab is not really a coast line, and it's also not really a grounding line. Take a look at the Ross Ice Shelf, where the coastlat and coastlon appear to follow the grounding line, but on the Filchner Ronne Ice Shelf it follows the edge of the ice. Amery and George VI are also a bit wonky. You can simply type
bedmap2('gl')
Or
bedmap2('coast')
to get more accurate outlines of the continent.

6 commentaires

C G
C G le 15 Août 2018
Modifié(e) : C G le 15 Août 2018
Oh I know, the coastline is terrible. I prefer the bedmap and that is what I have been using, but my supervisor likes the look of the map, other than Antarctica. Too bad we can't combine the two. I tried to use
setm(gca,'plabellocation',10,'labelrotation','on'); %and the one below
setm(gca,'plabellocation',10,'mlabelrotation','on');
but I got this error
Error using setm>setmaxes (line 103)
Handle must refer to a map axes.
Error in setm (line 49)
setmaxes(varargin{:});
Error in Map_4_poster (line 24)
setm(gca,'plabellocation',10,'mlabelrotation','on');
You can absolutely combine bedmap2 with map coordinates. Start from scratch and run this:
figure('Color','w')%Colors the figure white.
axesm('stereo','Origin',[-90 0],'MapLatLimit',[-90 -50]);
framem on;
gridm on;
mlabel on;
plabel on;
bedmap2('gl')
bedmap2('coast')
setm(gca,'plinelocation',10,'plabellocation',10,...
'labelrotation','on')
That should provide this image:
C G
C G le 15 Août 2018
It does! I am impressed and very grateful. Thank you so much.
Chad Greene
Chad Greene le 15 Août 2018
Fantastic. Glad it's working.
Amsalu Hundesa
Amsalu Hundesa le 8 Mar 2022
well don dear
Amsalu Hundesa
Amsalu Hundesa le 8 Mar 2022
how can i use for both latitude and lonigtude axes?

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by