Plotting multiple box plots on same graph with same size vector?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Matthew Peoples
am 15 Apr. 2021
Bearbeitet: ANKUR KUMAR
am 15 Apr. 2021
Hi everyone!
I've run into a strange issue. I have 5 1x60 double arrays that I am trying to plot boxplots of (5 boxplots on the same graph).
num_non_grey_pix_each_cat %1×5 cell array - each cell is 1x60
vects = [cell2mat(num_non_grey_pix_each_cat{1})]; % I tried just trying to plot 2
vects2 =[cell2mat(num_non_grey_pix_each_cat{2})];
vects = [vects; vects2];
figure;
boxplot(vects);
Trying to plot one plot works out fine, but then adding the second creates 60 boxplots? I'm very confused - i basically want five of the first plot on the one graph. Thank you so much!
0 Kommentare
Akzeptierte Antwort
ANKUR KUMAR
am 15 Apr. 2021
Bearbeitet: ANKUR KUMAR
am 15 Apr. 2021
As you have not provided the exact data, I am generating just the random data.
col=@(x)reshape(x,numel(x),1);
boxplot2=@(C,varargin)boxplot(cell2mat(cellfun(col,col(C),'uni',0)),...
cell2mat(arrayfun(@(I)I*ones(numel(C{I}),1),col(1:numel(C)),'uni',0)),varargin{:});
A={randi(25,1,100),randi(25,1,60),randi(25,1,60),randi(25,1,60),randi(25,1,60)}
boxplot2(A)
Reference:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data 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!