changing font size in all the elements of figures
420 次查看(过去 30 天)
显示 更早的评论
Hello, i want to make bigger all the text in a figure ( title, xlabel, axis,....), so i wrote this line of code in the beginning of the script: set(0,'defaulttextfontsize',30) but it doesn't change anything at all. Could you help me please, how can i change the font size? thank you
2 个评论
回答(4 个)
onewhaleid
2015-6-11
编辑:onewhaleid
2015-6-11
I use findall to change the font size for all text in a single figure:
set(findall(gcf,'-property','FontSize'),'FontSize',12)
4 个评论
Walter Roberson
2017-10-3
DefaultAxesFontSize is a better programming practice, but when you use set() the property names are not case sensitive.
set(0,'defaultaxisfontsize',30) or set(0, 'DefaultAxesFontSize', 30) only works for axes text created after the call to set(); it does not change the size for any existing text object, which the findall() version does change.
Sunisa Prasopporn
2023-2-2
编辑:Sunisa Prasopporn
2023-2-2
I would like to change 'FontSize' in clustergram heatmap. How should write the coding.
0 个评论
Adam Danz
2024-8-2
For example, to set the fontsize to 15 points for all* text in a figure fig,
fontsize(fig, 12, 'points')
Or all* text in an axes ax
fontsize(ax, 12, 'points')
Or you could increase or decrease fontsize using a scaling factor so that relative differences in font size are maintains.
fontsize(__,scale=1.2) % increase
fontsize(__,scale=0.8) % decrease
fontsize(__,'increase')
fontsize(__,'decrease')
* Some objects do not respond to the fontsize command
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!