Box Plot with Whiskers Plotted at Fixed Percentiles

Version 1.1.0.0 (2.81 KB) by Robert
This script uses boxplot but plots the whiskers for a specified percentile.
2.4K Downloads
Updated 19 May 2009

View License

Normally boxplot plots the whiskers with a maximum length based on the distance between the 25th and 75th percentile. This script uses boxplot but plots the whiskers for a specified percentile and only plots the outliers beyond the new whiskers.

Note that the percentile is defined as the data point just beyond the calculated percentile. For example, if the 98th percentile lies between the 4th and 5th highest data points, then the 4th highest data point will be considered the 98th percentile, the whisker will extend to the 4th highest, and only the 4 highest values will be plotted as outliers.

Cite As

Robert (2024). Box Plot with Whiskers Plotted at Fixed Percentiles (https://www.mathworks.com/matlabcentral/fileexchange/22526-box-plot-with-whiskers-plotted-at-fixed-percentiles), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Quartile & Percentile Calculation

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

Thanks, Peter, for pointing out the dependence on nanfree. I have added that function to the file. Also note that you need the statistics toolbox to access "boxplot"

1.0.0.0