Getting borders to appear on a map

52 views (last 30 days)
Sylvia
Sylvia on 23 Nov 2013
Commented: Sylvia on 2 Dec 2013
I am looking at sea surface temperatures in the North Pacific and trying to get borders to appear on my plots. I can only get the Alaska/Canada border (not the Russian one - see attached images). I know I could read through the Mapping Toolbox User's Manual and figure it out, but I am in a bit of a time crunch and wondering if anyone has a simple solution.
Right now the code I have to generate plots like those attached is:
figure (1) pcolor (lonSST', latSST', imrotate (mean (anomSST, 3), -90)) shading flat; colorbar hold on geoshow ('landareas.shp', 'FaceColor', 'white'); title ('Average SST anomaly','FontSize', 13, 'LineWidth', 1.75); xlabel ('Longitude'); ylabel ('Latitude');
Thanks, Sylvia.

Accepted Answer

Rob Comer
Rob Comer on 28 Nov 2013
Your call to geoshow isn't showing land areas west of -180 degrees because its working in an ordinary axes. Try setting up a map axes first. You could replace your call to figure with something like this:
figure('Color','w')
ax = worldmap([18 72],[-245 -110]);
setm(ax,'MapProjection','miller')
tightmap
You'll also have to use pcolorm instead of pcolor (and swap the order of the lat-lon inputs).
  1 Comment
Sylvia
Sylvia on 2 Dec 2013
Thanks, Rob. This works great!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!