필터 지우기
필터 지우기

Getting borders to appear on a map

조회 수: 14 (최근 30일)
Sylvia
Sylvia 2013년 11월 23일
댓글: Sylvia 2013년 12월 2일
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.

채택된 답변

Rob Comer
Rob Comer 2013년 11월 28일
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
Sylvia
Sylvia 2013년 12월 2일
Thanks, Rob. This works great!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by