Why can't I edit y label and x labels in matlab subplot figures (.FIG)

12 次查看(过去 30 天)
I have a 3 x 2 subplots (tiledlayout) with a common Y label and X label. I want to edit the labels and change the font and fontsize size but I'm unable to edit it.
The subplots axis labels were controlled by
tle = tiledlayout(3,2,"TileSpacing","compact");
tle.XLabel.String = 'Time';
tle.YLabel.String = 'Temp';
So its a single Y and X labels for the plots.this was done sometime ago and I need to edit the figs to change the fonts and fontsize. The problem does not affect figures with only one plot except for the subplots and tiledlayout figures.

采纳的回答

Star Strider
Star Strider 2023-9-21
I’m not certain what the problem is.
You can get the handles to each subplot with:
Axsp = subplot(3,2,4); % Fourth Subplot Axes
for that particular subplot.
You then have access to that subplot’s properties:
Axsp.XLabel = 'NewLabel'
Axsp.XLabel.FontSize = 12;
Example —
figure
subplot(3,2,4)
plot((0:0.1:2*pi), sin((0:0.1:2*pi)))
xlabel('Time (s)')
ylabel('Velocity (cm/s)')
Then later —
Axsp = subplot(3,2,4); % Fourth Subplot Axes
Axsp.XLabel.FontSize = 12;
.
  4 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by