BoxChart box position doesnt match xaxis label when 'groupbycolor'

8 views (last 30 days)
how to align xaxes label when using groupbycolor' option in boxchart?
as you can see on the web example xaxes isnt alignied to each boxplot.
the same appens in my boxchart.
how to solve it? thanks in advance
Danylyna Shpakivska
Danylyna Shpakivska on 21 Jul 2022
So the problem is that i dont have de same number of categories on xgroup data than on cgroupdata?
Anyway, there is somo way to adjust the xaxis manually? for example, getting the position of each boxchar? how can I access to that?

Sign in to comment.

Accepted Answer

Adam Danz
Adam Danz on 21 Jul 2022
The example you shared from the documentation (link) uses grouped data. Groups are centered around the x-ticks. If you are missing members of group, the missing groups will appear as empty space.
If I add vertical grid lines and expand the image, this is easier to see.
I have a feeling you're also using grouped data to control the colors of your boxplots and your missing groups appear as empty space.
  1 Comment
Danylyna Shpakivska
Danylyna Shpakivska on 21 Jul 2022
okay i think i have solved it. thank you so much
I was grouping the Y variable both on x groupdata and cgroup data.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!