How can I change the font size of plot tick labels?
Show older comments
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.)
Accepted Answer
More Answers (1)
Zaid hamamah
on 25 Apr 2022
Edited: Adam Danz
on 29 Jan 2024
18 votes
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 Comments
nuri hakan aydin
on 20 Aug 2022
Very helpful, thank you!
Zong-Jhen Ye
on 10 Oct 2022
Thank you very much for your sharing.
Isacc Alpala
on 12 Jan 2024
Really helpful. Thanks!
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!