如何在Matlab Geoshow中更改轴的位置和属性

时间:2019-03-27 10:31:34

标签: matlab

我想通过使用worldmap和一些shapefile来创建地图,但是轴的字体大小对于我的目的来说太小了,x轴也应该在图的外部。但是直到现在我还是无法解决问题。

我尝试使用set(gca,'FontSize', 20)以及axism来更改字体大小,但两者均无效。

S = shaperead('BRA_water_areas_dcw.shp');
index = find(strcmp({S.NAME}, 'RIO TAPAJOS')==1)
shapewrite(S(index), 'TapajosRiver')

figure
%h = worldmap('Brazil')
%h = worldmap([-10.6754 1.4350], [-67.3784 -35.2984])
h = worldmap([-22.7933 5.7], [-69.2028 -32.2213])
m = getm(h, 'MapProjection')
geoshow('landareas.shp', 'FaceColor', [0.15 0.7 0.15])
geoshow('BRA_water_areas_dcw.shp', 'FaceColor', 'blue')
geoshow('TapajosRiver.shp', 'FaceColor', 'red')
set(gca,'FontSize', 22,'FontWeight','bold')

当前图形如下所示: enter image description here

1 个答案:

答案 0 :(得分:1)

要解决字体大小问题,可以使用建议的代码rinkert:

set(findall(gca, 'type', 'text'),'FontSize', yoursize)