I have these boxplots and I need to show the boxplots in groups.

1 回表示 (過去 30 日間)
zhoug zho
zhoug zho 2021 年 7 月 1 日
コメント済み: Rik 2021 年 7 月 8 日
I have these boxplots and I need to show the boxplots in groups.
e.g, from this figure, first boxplot is one group, it has only one boxplot, then 2ndgroup has six boxplots and 3rd group has 3 boxplots and 4 group also has 3 boxplot and 4th group has one boxplot.
So, I need to show these boxplot groups in same colors in this plot,
Like all boxplots of group 2 with the same color and similarly, all boxplots of 3rdgroup with same colour , and so on. If there is any way, also, to insert lines between the groups that will be good as well. Thanks in advance.
  4 件のコメント
Rik
Rik 2021 年 7 月 1 日
You can plot them with separate calls to the boxplot function to create separate objects. Then you can easily manipulate them separately. Don't forget hold('on').
Rik
Rik 2021 年 7 月 8 日
Why did you edit away the image?

サインインしてコメントする。

回答 (1 件)

Sam
Sam 2021 年 7 月 1 日
編集済み: Sam 2021 年 7 月 1 日
Try boxcharts instead of boxplots, it is more flexible and has an option for plot grouping by color. Refer to this link for more information.

Community Treasure Hunt

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

Start Hunting!

Translated by