How can I change the font size of plot tick labels?
Ältere Kommentare anzeigen
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.)
Akzeptierte Antwort
Weitere Antworten (1)
Zaid hamamah
am 25 Apr. 2022
Bearbeitet: Adam Danz
am 29 Jan. 2024
18 Stimmen
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 Kommentare
nuri hakan aydin
am 20 Aug. 2022
Very helpful, thank you!
Zong-Jhen Ye
am 10 Okt. 2022
Thank you very much for your sharing.
Isacc Alpala
am 12 Jan. 2024
Really helpful. Thanks!
Kategorien
Mehr zu Axis Labels finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!