Box plot y-axis
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Kelly Kearney
2013-6-13
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).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!