Boxplot how to make the box widths proportional to sample size
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Rik
am 21 Feb. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Histograms 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!