Map axis description (degrees).
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kamil Nowak
el 24 de Mayo de 2018
Respondida: jonas
el 25 de Mayo de 2018
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)?
0 comentarios
Respuesta aceptada
jonas
el 25 de Mayo de 2018
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 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!