How to change the font size of a map axes (created using the Mapping toolbox) keeping the whole plot within the figure?

12 ビュー (過去 30 日間)
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?

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 6 月 15 日
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 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 6 月 15 日
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
Benoit Espinola
Benoit Espinola 2020 年 6 月 15 日
Thanks, that's really odd, as the mapping toolbox is a paid option.\

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by