Show lat lon ticks with Mapping toolbox and pcolorm

10 views (last 30 days)
How can I show the lat lon ticks around a pcolorm map using the Mapping toolbox?
Here is how I define my axis :
axesm('MapProjection','eqdcylin','Origin',[Grd_xlat1 Grd_xlon1 90-az],'FLonLimit',[lon1 lon2],'FLatLimit',[lat2 lat1],'frame','on','FlineWidth',2,'FFill',400,'grid','on','MeridianLabel','off','ParallelLabel','off','MLabelParallel','south','Aspect','normal')
I tried to switch MeridianLabel and ParallelLabel to on, but it doesn't change anything.
Thank you.

Answers (1)

Cam Salzberger
Cam Salzberger on 12 Dec 2017
Hello Frank,
Try setting the 'MLineLocation' and 'PLineLocation' map axes properties to appropriate values.
-Cam
  5 Comments
frank2243
frank2243 on 12 Dec 2017
I attached a quick map I just did in the original post. I would like lat/lon ticks to be shown around the box.
Cam Salzberger
Cam Salzberger on 12 Dec 2017
I did some experimentation with some example data:
figure
axesm('MapProjection','eqdcylin','Origin',[40 125 90-30],'FLonLimit',[115 135],'FLatLimit',[30 45],'grid','on')
load topo
[lat lon] = meshgrat(topo,topolegend,[90 180]);
pcolorm(lat,lon,topo)
demcmap(topo)
tightmap
setm(gca,'MeridianLabel','on','ParallelLabel','on','MLineLocation',5,'PLineLocation',5,'MLabelLocation',5,'PLabelLocation',5)
If you remove the 'Origin' specification in the map axes, the labels show. If you experiment with large origin values on larger maps:
figure('Color','white')
load topo
axesm('miller','Origin',[90 45 30])
axis off; framem on; gridm on;
[lat lon] = meshgrat(topo,topolegend,[90 180]);
pcolorm(lat,lon,topo)
demcmap(topo)
tightmap
setm(gca,'MeridianLabel','on','ParallelLabel','on','MLineLocation',5,'PLineLocation',5,'MLabelLocation',5,'PLabelLocation',5)
you can see that it warps where the labels will show up on the map. I believe that is what is happening here, and the labels are simply outside the frame. I'd suggest playing around with map limits to see where the labels end up on your map, and modifying settings until you can get them where you want them.
-Cam

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!