How can I change the font size of plot tick labels?
古いコメントを表示
I am trying to change the font size of the tick labels (the numbers) in my plots. (Just to be clear, I am NOT referring to the axis labels.)
採用された回答
その他の回答 (1 件)
Zaid hamamah
2022 年 4 月 25 日
編集済み: Adam Danz
2024 年 1 月 29 日
18 投票
I know it is too late but just for the future readers: (i am using version R2021a)
1) To change the font size of all texts included of (ax) axes, such as y- and x- axes labels in addition to the title or any other text like tick labels:
ax.FontSize =
2) To change all the text attached to one specific axis: (tick labels and label)
ax.XAxis.FontSize =
3) To change only the size of the label:
ax.XLabel.FontSize =
The same goes for y-axis using:
ax.YAxis.FontSize =
ax.YLabel.FontSize =
So if you want to change the tick labels, you can use a general command like the second one, and then readjust the label specifically using the third command.
Lastly, to control the relative difference in font size between the tick labels and axis label:
ax.LabelFontSizeMultiplier =
3 件のコメント
nuri hakan aydin
2022 年 8 月 20 日
Very helpful, thank you!
Zong-Jhen Ye
2022 年 10 月 10 日
Thank you very much for your sharing.
Isacc Alpala
2024 年 1 月 12 日
Really helpful. Thanks!
カテゴリ
ヘルプ センター および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!