How can I change the font size of plot tick labels?
Mostrar comentarios más antiguos
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.)
Respuesta aceptada
Más respuestas (1)
Zaid hamamah
el 25 de Abr. de 2022
Editada: Adam Danz
el 29 de En. de 2024
18 votos
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 comentarios
nuri hakan aydin
el 20 de Ag. de 2022
Very helpful, thank you!
Zong-Jhen Ye
el 10 de Oct. de 2022
Thank you very much for your sharing.
Isacc Alpala
el 12 de En. de 2024
Really helpful. Thanks!
Categorías
Más información sobre Axis Labels en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!