Y-axis in subplots of Boxplot

Hi
I am making several subplots in 1 figure using Boxplot and subplot. But how can I adjust the y-axis, so that in each boxplot the y-axis goes from e.g. 0 to 120, with ticks at 0, 10, 20 etc.?
Thanks for your support
Jarno

 채택된 답변

Grzegorz Knor
Grzegorz Knor 2011년 12월 7일

0 개 추천

X = rand(100,25)*120;
subplot(2,1,1)
boxplot(X)
ylim([0 120])
set(gca,'YTick',0:10:120)
subplot(2,1,2)
boxplot(X,'plotstyle','compact')
ylim([0 120])
set(gca,'YTick',0:10:120)

추가 답변 (1개)

JW
JW 2011년 12월 7일

0 개 추천

Thanks for your help!
Is it also possible to integrate a boxplot into a normal plot, by plotting through the means?

댓글 수: 3

Grzegorz Knor
Grzegorz Knor 2011년 12월 7일
Maybe 'hold on' command?
JW
JW 2011년 12월 8일
that doesn't work, as my x-axis data points are at [0 3 10 100] and boxplot uses a fixed distance between points..
Grzegorz Knor
Grzegorz Knor 2011년 12월 8일
Can you paste some code?

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

질문:

JW
2011년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by