Boxplot Label Numberical Organization
Mostrar comentarios más antiguos
I am trying to graph multiple boxplots on a figure that have varying x values. I am inserting these labels into the boxplot function like so:
b = boxplot(ErrorPlot, 'Labels', weight);
However, I face an issue when the labels vary in distance. When graphing a set of labels, like seen in the image, the boxplots are equidistant regardless of what their labels say. Is it possible to ensure that these boxplots are graphed with a distance matching their label value (i.e. 10 and 20 are only 1/10th as far from each other as 100 and 200 are)?

Respuesta aceptada
Más respuestas (1)
dpb
el 11 de Jul. de 2022
Not an option w/ builtin boxplot, sorry.
You can make it work with the alternate boxchart function, but the large scale factor will probably end up with the boxes only being vertical lines as the spacing between the axis values is almost all white space.
I tried
x=randi(20,[20,4]);
g=[10 20 100 200].*ones(size(x));
hBC=boxchart(g(:),x(:));
with just a subset of your x values above -- it was less than satisfactory, methinks --

There is not an optional input to let one set the width of the boxes independently; whether one could go "handle-diving" and uncover the pieces and modify them or not I didn't explore.
1 comentario
Aaditya Pore
el 12 de Jul. de 2022
Categorías
Más información sobre Box Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
