multiple boxplots in one figure
显示 更早的评论
hi. i want to make box plots of three matrices (a, b and c) vs , each of order 1x31. but i want all boxplots in the same figure. anyone? thanks.
回答(1 个)
Star Strider
2018-5-17
Try this:
a = randn(1,31);
b = randn(1,31)*2 + 2;
c = randn(1,31)/2 + 3;
figure(1)
boxplot([a(:) b(:) c(:)])
set(gca, 'XTickLabel', {'a','b','c'}) % Optional
It forces them to become column vectors, horizontally concatenates them, and plots them.
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!