Box Plot with Whiskers Plotted at Fixed Percentiles

This script uses boxplot but plots the whiskers for a specified percentile.

You are now following this Submission

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 (2026). 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 .

Acknowledgements

Inspired by: Quartile & Percentile Calculation

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
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