Boxplot Labels with more than one line
이전 댓글 표시
I am using the boxplot function to plot a grouped data set. I want the labels to have two lines: A name and the number of points (n).
for example:
%in a loop I set each label:
for i = 1:p
label2{i} = sprintf(label{i} '\n n = %d'], n(i)));
end
boxplot(data,G,'labels',char(label2{:})
The problem is that the label end up halfway above/below the xaxis line. I can use the findobj to get the text labels but not sure how to correct their position. I tried adding newlines in front of the labels but boxplot just ignored them. Any help?
I suppose a work around would be to make my own text labels for each box, but I think having them in the xlabel axis would be nice. I plan on making about 30 boxplot graphs like this so it would be nice to be able to do it programatically.
Liam
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Box Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!