Hi Matlab Users I have a problem with the boxplot function. I am doing the following:
axes('FontSize', 18,'FontName','arial');
boxplot(R,'labels',{'cocos','sandias','melones'})
la problem here is that XTickmark size does not chage to 18 points size while the YTickmark it does.
Do you have any idea of how I can fix this?
Thanks
carlos

답변 (2개)

Walter Roberson
Walter Roberson 2011년 3월 3일

2 개 추천

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.

댓글 수: 5

Carlos Minjarez
Carlos Minjarez 2011년 3월 4일
Thank you
carlos
Eber Risco
Eber Risco 2011년 5월 26일
Thank a lot....
Nick Palmius
Nick Palmius 2014년 3월 18일
편집: Nick Palmius 2014년 3월 18일
To correct the text overlap, the following works quite well:
txt = findobj(gca,'Type','text');
set(txt(3:end),'VerticalAlignment', 'Middle');
The start index (3) must be updated depending on the number of axis labels etc. are on the figure.
Peng Zhong
Peng Zhong 2014년 8월 26일
thank you,Nick. Very helpful.
desword jacky
desword jacky 2016년 12월 11일
how to deal with the overlapping between the xticklabel and xlabel when the fontsize is 25?

댓글을 달려면 로그인하십시오.

Sav Deb
Sav Deb 2012년 11월 29일

0 개 추천

How to do the same but in Property Editor

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

질문:

2011년 3월 3일

댓글:

2016년 12월 11일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by