BoxChart box position doesnt match xaxis label when 'groupbycolor'
30 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Danylyna Shpakivska
am 21 Jul. 2022
Bearbeitet: Adam Danz
am 17 Nov. 2022
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
2 Kommentare
dpb
am 21 Jul. 2022
It's centered on the group; you don't have both colors in all groupings so it's an optical delusion at RHS of example...yours has only one for all groupings.
Akzeptierte Antwort
Adam Danz
am 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.
4 Kommentare
Adam Danz
am 17 Nov. 2022
Bearbeitet: Adam Danz
am 17 Nov. 2022
@Alejandro Nogueron Aramburu, follow this example from the documentation. Group by cgroupdata. You can ignore the last line of code in the example - that line shows how to change a box color.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Legend finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!