Question on how to delete the data (outliers) in the boxplot
Afficher commentaires plus anciens
Hello everyone.
I need to know how to eliminate the representation of outliers (> 95%) in a boxplot representation.
Any suggestion?
Thank you
4 commentaires
Adam Danz
le 28 Août 2020
Does that mean you want to compute and plot the box plots using all of your data and then remove some of the plotted outliers? Or do you want the boxplots to represent the data after outliers are removed?
What does >95% mean? Does it mean values that are larger/smaller than 95% of the median?
Luís Barbosa
le 28 Août 2020
Binbin Qi
le 28 Août 2020
I think you can use
rmoutliers(A,'percentiles',threshold)
Réponse acceptée
Plus de réponses (1)
As per boxplot's documentation, each aspect of a boxplot is tagged and we can find them with findobj:
ax=axes;
boxplot(ax,[-3,repelem(3:8,10),14]) % Should contain two outliers at y=-3 and y=14.
% Obtain graphics handle for outliers:
o=findobj(ax.Children,'Tag','Outliers');
% We can now change all aspects of the markers:
set(o,'Marker','h','MarkerSize',12)
We could now make the outliers invisible or delete them from the plot, but I encourage folks to read Adam's post above!
% set(o,'Marker','none') % Misleading
% o.Visible = 'off' % Misleading
% delete(o) % Danger, danger!
Let me repeat Adams' words of wisdom that "... removing outlier markers should usually be avoided and can be very deceptive."
Catégories
En savoir plus sur Box Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

