How can I make a box plot for the data in "trials" but have the "outcome" on the y-axis? If I re-size the axis I get only a portion of the box plot.
trials=[98 72 79 50 58 38 17 9 3 3]
outcome=[1 2 3 4 5 6 7 8 9 10]
(read: on 98 trials outcome 1 came, on another 72 trials outcome 2 came)
Thanks a lot!

댓글 수: 2

the cyclist
the cyclist 2013년 6월 13일
Do you already have code for making the box plot? Can you post that?
petya
petya 2013년 6월 14일
x = arrayfun(@(a,b) ones(a,1)*b, hit_box, outcome, 'uni', 0) x = cat(1, x{:}) boxplot(x)

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

 채택된 답변

Kelly Kearney
Kelly Kearney 2013년 6월 13일

0 개 추천

Is this the sort of thing your looking for?
x = arrayfun(@(a,b) ones(a,1)*b, trials, outcome, 'uni', 0)
x = cat(1, x{:})
boxplot(x)
(Though given the skewedness of your data, a histogram might be a better choice for visualization).

댓글 수: 1

petya
petya 2013년 6월 14일
Yes! Thank you so much!
best p

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

추가 답변 (0개)

카테고리

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

태그

질문:

2013년 6월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by