matlabplotnetcdfgeomap

How to change longitude label locations in matlab worldmap


I am trying to generate some contour plots using data in netCDF format in Matlab. I've managed to load in the data and retrieve latitude, longitude information, but got bit stuck in making the plot looks right. The thing I want to change is the locations of the longitude labels. Now they are labelled along the equator (see Fig below), making them difficult to read. I want to move them to the bottom of the plot. Please give me some clue how to control this.

enter image description here

Here is the block of code that I am developing that creates the plot:

latax=-89:1:89;
lonax=0:1:360;

figure
axesm('braun','MLabelParallel',-60);
worldmap([latax(1),latax(end)],[lonax(1),lonax(end)]);
hold on;
load coast;
plotm(lat,long,'k-');    

where latax and lonax are the latitude and longitude vectors, respectively. I thought the line axesm('braun','MLabelParallel',-60); sets the latitudinal location for the longitude labels but it didn't seem to make any difference.


Solution

  • The position of these labels can be controlled with the setm command (I'm using 2015a). If your worldmap axes are defined as:

    ax = worldmap([latax(1),latax(end)],[lonax(1),lonax(end)]);
    

    to put the labels at the bottom of the plot, do

    setm(ax,'mlabelparallel',-90)
    

    the 'plabelmeridian' is the equivalent property for the latitude labels.