フィルターのクリア

multiple boxplots in one figure

3 ビュー (過去 30 日間)
sud
sud 2018 年 5 月 17 日
回答済み: Star Strider 2018 年 5 月 17 日
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
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.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by