Boxplot how to make the box widths proportional to sample size
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like to modify the box widths proportional to the sample size. Similar to the attached figure.
Can I do this with Matalb?
thanks
0 commentaires
Réponses (1)
Rik
le 21 Fév 2022
There is no function in Matlab that does this natively, but you can write it from scratch.
If it is important to you that your code works on older Matlab releases you will have to make something with patch and line objects (see their documentation for help). For newer releases you can use the boxchart function. The boxplot function is in a toolbox, so that also has limited compatibility (although it is supported by older releases than those supporting boxchart).
The main idea would be to plot your boxes in a loop, 1 per iteration, in which you set the width yourself.
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!