How can I specifiy the colors when using the group by color option in boxchart?
Show older comments
Hi everyone,
I am using the boxchart function to plot some grouped data. It works fine, but I cannot find a way to specify the colors of the boxes? I tried it like this:
boxchart(trialtable_NOV.Name,trialtable_NOV.HB,'BoxFaceColor',{[0 0 1],[1 0 0]},'GroupByColor',trialtable_NOV.COND);
This does not work. I also tried to access the axes.children, but it only lets me set one color and if I change it, it changes the color of all boxes which loses the color distinction between groups. I did a quick search online and could not find any solutions, so I hope you can help me out.
Cheers
2 Comments
Rouven Kenville
on 18 Dec 2020
Jiafeng Ye
on 9 Sep 2021
Hi Rouven, I have the similar problem you used to had. I want to assign the box color mannully for two groups with non-default colors. Would you mind being a bit more specific about how to use the seriousindex to achieve that? Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Color and Styling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

