Map axis description (degrees).

7 次查看(过去 30 天)
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