3

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.

Jason
  • 2,950
  • 2
  • 30
  • 50
  • can you post runnable code so we can try it? – Ander Biguri Jul 20 '15 at 10:09
  • @AnderBiguri Yes, just did it. – Jason Jul 20 '15 at 10:27
  • I am not sure if you can.... I have been playing with the properties returned by `worldmap`, and they dont seem to change anything. It looks like the axes that are actually created and ploted are somehow lost in the code, and the handle that `worldmap` returns does not change the one that is plotted. Ill dig a bit mroe – Ander Biguri Jul 20 '15 at 10:39

1 Answers1

2

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.

Carlos
  • 318
  • 2
  • 11