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');

參考地址:

http://www.mathworks.com/matlabcentral/answers/2461-boxplot-xtick-label-size

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM