- Use a grouping variable along with the "Group Appearance" options described in Matlab's boxplot() documentation.
- Checkout boxplot2 from the file exchange
- Check out boxplotGroup from the file exhchange.
How do I make a boxplot with a few groups?
49 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
a = rand(10,2);
b = rand(10,2);
boxplot([a,b]);
I want to have one figure with to groups - a and b, where the two vectors of 'a' will be close and the two vectors of 'b' will be close, but the two groups will be far from one another.
Thanks,
Ziv
1 commentaire
Adam Danz
le 24 Sep 2020
Réponses (1)
Abdolkarim Mohammadi
le 1 Sep 2020
Modifié(e) : Abdolkarim Mohammadi
le 1 Sep 2020
You can add some columns of NaN.
a = rand(10,2);
b = rand(10,2);
c = nan(10,2);
boxplot([a,c,b]);
xticks ([1,2,5,6]);
xticklabels (["a1","a2","b1","b2"]);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/354509/image.jpeg)
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!