2

I am plotting a contour over the mercator(planar) world map in MATLAB.

And I am successful but when I use the

geoshow('landareas.shp','FaceColor', [0.5 1.0 0,5]) 

it eliminates the contour plot on the map.

My code is:

axesm('mercator','MapLatLimit',[-50 90],'MapLonLimit',[0 250])

frame on;

grid on;

plotm(lat,long,'k')

contourfm(x,y,z)

Is there anyway to apply the

geoshow('landareas.shp','Display',[0.5 1.0 0.5])
Minimalist
  • 963
  • 12
  • 34

1 Answers1

2

I do not know what exactly you would like to achieve so if my answer will be in a wrong direction we can elaborate more.

I used this code to produce a map with contourfm and 'landareas':

load geoid;
figure(1) 
axesm ('mercator','MapLatLimit',[-50 90],'MapLonLimit',[0 250])
contourfm(geoid,geoidrefvec, 'LineStyle', 'none');
geoshow('landareas.shp', 'FaceColor', [0.5 1.0 0.3]);

enter image description here

Instead of geoid you can have your own map but pay attention on the number of grid points. As far as I know they have to be 180x360.

One note. You may consider to use coast in stead of landareas because contourfm produces all colour map and 'landareas' has also colours. So if it suit you, you can put only coast lines instead:

load geoid;
figure(2)
axesm ('mercator','MapLatLimit',[-50 90],'MapLonLimit',[0 250])
contourfm(geoid,geoidrefvec, 'LineStyle', 'none');
load coast
plotm(lat, long,'black') % plot the coast on the map

contourfm with coast

MasterPJ
  • 389
  • 7
  • 18
  • MasterPJ -- Thanks so much. I have been needing an answer for sometime. I almost gave up. – Minimalist Dec 06 '12 at 22:01
  • Please help me with this query: http://stackoverflow.com/questions/39155845/attaching-customized-colormap-to-geoshow-in-matlab – Munish Aug 25 '16 at 22:46