Plotting multiple box plots on same graph with same size vector?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Matthew Peoples
le 15 Avr 2021
Modifié(e) : ANKUR KUMAR
le 15 Avr 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 commentaires
Réponse acceptée
ANKUR KUMAR
le 15 Avr 2021
Modifié(e) : ANKUR KUMAR
le 15 Avr 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Exploration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!