300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > matlab boxplot 字体大小 matlab中boxplot字体大小设置

matlab boxplot 字体大小 matlab中boxplot字体大小设置

时间:2021-09-18 05:27:54

相关推荐

matlab boxplot 字体大小 matlab中boxplot字体大小设置

网上找到的:

set(findobj(gca,'Type','text'),'FontSize',18)

boxplot() uses the default axes labeling for the Y axes, but for the X axes, it uses text() to put the labels in place and it does not grab the axes FontSize when it does so.

Note: it is likely that with an 18 point font that the labels will overlap the y=0 axes.

意思就是boxplot的y轴坐标字体用的是默认的,可以通过

set(gca, 'Fontsize', 14);

来修改

而x轴字体是通过text()放进去的,不能通过默认方法修改,可以通过修改Type=Text类型的字体来做到

set(findobj(gca,'Type','text'),'FontSize',18)

不过字体太大重叠了,用这个方法可以避免重叠

txt = findobj(gca,'Type','text');

set(txt(3:end),'VerticalAlignment', 'Middle');

参考地址:

/matlabcentral/answers/2461-boxplot-xtick-label-size

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。