Box Plot with Whiskers Plotted at Fixed Percentiles
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
Platform Compatibility
Windows macOS LinuxCategories
- AI, Data Science, and Statistics > Statistics and Machine Learning Toolbox > Descriptive Statistics and Visualization > Statistical Visualization > Box Plots >
Tags
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!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.