Getting borders to appear on a map

19 vues (au cours des 30 derniers jours)
Sylvia
Sylvia le 23 Nov 2013
Commenté : Sylvia le 2 Déc 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.

Réponse acceptée

Rob Comer
Rob Comer le 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 commentaire
Sylvia
Sylvia le 2 Déc 2013
Thanks, Rob. This works great!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by