Matlab, can you create a separate font size for the x tick mark label and y tick mark label?
Afficher commentaires plus anciens
Matlab, I would like the font sizes to be independent for all the axis attributes. Currently, the x and y axis labels must be the same size, and the tick labels for each axis must be the same size. I would like to have the x tick labels be size 12 and the y tick labels be size 20. I'd imagine that someone out there is interested in doing something similar for the axis labels also. While that is a long term fix, my current problem is that the greek letter pi displays at about half the height of numbers. While I am aware that I can put a text box in with a different font size, that isn't really an efficient solution.
Thanks,
dack
Réponse acceptée
Plus de réponses (1)
In R2016a (and probably anything R2014b or after), you can set different font sizes for each axis using
ax = gca;
ax.XAxis.FontSize = 12;
ax.YAxis.FontSize = 20;
To get a separate font size within a single label (if you use the default 'tex' interpreter) use
'2\fontsize{32}\pi' % or whatever font size you prefer
You could also use a secondary label to indicate that your values are multiples of pi using
set(ax.XAxis.SecondaryLabel,'Visible','on','String','\times\pi','FontSize',22)
Catégories
En savoir plus sur Axis Labels dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!