How can I change the font size of plot tick labels?
Mostra commenti meno recenti
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.)
Risposta accettata
Più risposte (1)
Zaid hamamah
il 25 Apr 2022
Modificato: Adam Danz
il 29 Gen 2024
18 voti
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 Commenti
nuri hakan aydin
il 20 Ago 2022
Very helpful, thank you!
Zong-Jhen Ye
il 10 Ott 2022
Thank you very much for your sharing.
Isacc Alpala
il 12 Gen 2024
Really helpful. Thanks!
Categorie
Scopri di più su Axis Labels in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!