MATLAB Answers

John Soong

boxplot insists on removing outliers, is there an option to disable outlier removal?

Asked by John Soong
on 30 Nov 2012

I want to completely disable outlier removal. My data is not normally distributed, so I need all the points to affect the mean.




No products are associated with this question.

1 Answer

Answer by Tom Lane
on 30 Nov 2012

Can you explain more about what you want? Ordinarily the boxplot doesn't remove outliers, but instead shows them as separate markers on the plot. Is that what you want to prevent? Here are two invocations of boxplot, one of which includes the outlier in the box-like part rather than as a separate marker:


The line across the center of the box is at the median, not the mean, so the outlier doesn't really affect its value directly.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!