Map axis description (degrees).

조회 수: 7 (최근 30일)
Kamil Nowak
Kamil Nowak 2018년 5월 24일
답변: jonas 2018년 5월 25일
Welcome. At the beginning, I apologize for my English.
Below is a fragment of the matlab code:
landareas=shaperead('landareas.shp','UseGeoCoords',true);
axesm ('mercator','Frame','on','Grid','on');
geoshow(landareas,'FaceColor',[1 1 .5],'EdgeColor',[.6 .6 .6]);
showaxes;
xtixr = get(gca, 'XTick');
xtixlbl = regexp(sprintf('%.1f°\n',xtixr*180/pi), '\n', 'split');
set(gca, 'XTick', xtixr, 'XTickLabel',xtixlbl)
ytixr = get(gca, 'YTick');
ytixlbl = regexp(sprintf('%.1f°\n',ytixr*90/pi), '\n', 'split');
set(gca, 'YTick', xtixr, 'YTickLabel',ytixlbl)
hold on
As a result I get this:
But I need something like that:
How to improve my code to get meridians and parallels at regular intervals? (picture number 2).
The second question is how to put the description of the axis so that it covers only the drawing window? (as in the second image) In the range from 0 to 180 degrees (horizontal) and from 0 to 90 degrees (vertically)?

채택된 답변

jonas
jonas 2018년 5월 25일
It is easier than you think, try this
landareas=shaperead('landareas.shp','UseGeoCoords',true);
axesm ('mercator','Frame','on','Grid','on',...;
'FLatLimit',[-90 90],...
'FLonLimit',[-180 180])
gridm('on');axis off;mlabel on;plabel on
geoshow(landareas,'FaceColor',[1 1 .5],'EdgeColor',[.6 .6 .6]);
set(gca,'position',[0 0 1 1])

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by