Filter löschen
Filter löschen

Multiple Boxplots on same figure

179 Ansichten (letzte 30 Tage)
Soleil Hernandez
Soleil Hernandez am 13 Jun. 2016
Beantwortet: the cyclist am 13 Jun. 2016
I have 3 sets of data that I am trying to display in 3 different boxplots on the same figure.
for example right now I have
A=[16 20 15 17 22 19 17]'
B=[22 15 16 16 16 18]'
C=[23 9 15 18 13 27 17 14 16 15 21 19 17]'
Other answered questions have the same about of data in each set where as I have 3 different sized sets of data.
I've tried using figure, and hold on but I still can't seem to format this correctly
Thank you

Akzeptierte Antwort

the cyclist
the cyclist am 13 Jun. 2016
Here is one way:
A = [16 20 15 17 22 19 17]';
B = [22 15 16 16 16 18]';
C = [23 9 15 18 13 27 17 14 16 15 21 19 17]';
group = [ ones(size(A));
2 * ones(size(B));
3 * ones(size(C))];
figure
boxplot([A; B; C],group)
set(gca,'XTickLabel',{'A','B','C'})

Weitere Antworten (0)

Kategorien

Mehr zu Visual Exploration 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!

Translated by