フィルターのクリア

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

12 ビュー (過去 30 日間)
Stephen Tete
Stephen Tete 2023 年 9 月 21 日
コメント済み: Star Strider 2023 年 9 月 22 日
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 件のコメント
Stephen Tete
Stephen Tete 2023 年 9 月 22 日
The last answer works, thank you
Star Strider
Star Strider 2023 年 9 月 22 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by