How to change the font size of a map axes (created using the Mapping toolbox) keeping the whole plot within the figure?
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Benoit Espinola
el 15 de Jun. de 2020
Comentada: Benoit Espinola
el 15 de Jun. de 2020
Greetings,
I am trying to create a map for a publication and I would like to (easily) change the FontSize of my map axes and still have the axes printed inside the figure.
I am using the following code:
latLim = [-53.7 -52];
lonLim = [-41 -39.2];
figure
h = worldmap(latLim, lonLim);
setm(gca, 'FontSize', 20);
This code yields to this figure:
As you might notice, the longitudes are cropped.
PS: I want to keep the following:
get(gcf, 'position')
ans =
560 528 560 420
How can I make sure the map will be plotted in a correct manner inside this figure?
0 comentarios
Respuesta aceptada
Ameer Hamza
el 15 de Jun. de 2020
Try to reduce the axes size
latLim = [-53.7 -52];
lonLim = [-41 -39.2];
figure
h = worldmap(latLim, lonLim);
setm(gca, 'FontSize', 14);
h.Position(4) = h.Position(4)-0.1;
3 comentarios
Ameer Hamza
el 15 de Jun. de 2020
Overall, I find Matlab graphics function to be convenient, however, I never used worldmap() before. I agree that the way worldmap is created, is a real mess. I don't think there is an easy way to rotate the labels. Following shows a workaround, but making any adjustment to the position of labels is quite difficult.
latLim = [-53.7 -52];
lonLim = [-41 -39.2];
figure
h = worldmap(latLim, lonLim);
setm(gca, 'FontSize', 14);
h.Position(4) = h.Position(4)-0.1;
lbls = findobj(h, 'Tag', 'PLabel');
[lbls.HorizontalAlignment] = deal('center');
[lbls.Rotation] = deal(-90);
for i=1:numel(lbls)
lbls(i).Position = lbls(i).Position - 15000;
end
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!