Alternative box plot

Draw a box plot with various display options
10.7K 次下载
更新时间 2018/5/5

编者注: This file was selected as MATLAB Central Pick of the Week

NOTE: this function is now available from the IoSR Matlab Toolbox as iosr.statistics.boxPlot.
-------------------------
Alternative box plot function for Matlab with many options. These options include:
- Variable sample sizes (via the tab2box() function).
- Show box sample size.
- Scaled or uniform box spacing.
- Box width scaled by sample size.
- Overlay scatter plots of underlying data.
- Overlay the mean of the data.
- Overlay additional percentiles, and attach labels to them.
- Hierarchical X-labeling and support for multidimensional data.
- Notched boxes.
- Vertical lines to separate groups.
- Automated construction of a legend.
- Set box limits as percentiles.
- Set whisker extent via various methods.
- Use of weighted quantiles.
- Creation of violin plots.

引用格式

Christopher Hummersone (2024). Alternative box plot (https://github.com/IoSR-Surrey/MatlabToolbox), GitHub. 检索时间: .

MATLAB 版本兼容性
创建方式 R2015a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!

无法下载基于 GitHub 默认分支的版本

版本 已发布 发行说明
3.2.1.0

Updated version number.
Updated description.
Added acknowledgement.
Moved function in to updated toolbox.
Function now natively supports sub-groups, handles NaNs more robustly, and returns sample size(s). A few other minor tweaks and doc changes.

3.1.1.0

Added percentile options for box and whisker extent. Modified help to clarify scatter plotting.
Moved file to Github.

3.1.0.0

Added 'theme' property to allow multiple display properties to be changed simultaneously. Various bug fixes.

3.0.2.0

More bug fixes. Forced legend alpha to match box alpha.

3.0.1.0

Added ability to specify colors as a colormap function. Changed some size properties to no longer be specifiable for each group. Bug fixes.

3.0.0.0

Re-implemented function as a class (with a new name). Added property to automate construction of a legend.

2.0.8.0

Added meanSize property.

2.0.7.0

Corrected calculation of mean when data include NaN. Updated picture.

2.0.6.0

Added options for displaying the means.

2.0.5.0

Added trap for MarkerEdgeAlpha (scatterAlpha), which older versions of Matlab do not support.

2.0.4.0

Added layer and transparency options.

2.0.3.0

Fixed automatic placement of boxes.

2.0.2.0

Corrected bug where x offset was erroneous if y was not hierarchical.

2.0.1.0

Small tweaks to improve robustness.

2.0.0.0

Numerous changes to interface in order to support multidimensional data and improve hierarchical data labelling. Added scaleWidth option to scale box widths according to sample size.

1.6.3.0

Added x-shaping to outliers and tweaked offset distribution.

1.6.2.0

Added x shaping for overlayed scatter plots whereby the random x offset is related to the data distribution. Fixed bug whereby xSeparator handle would be sought even if xSeparator was not specified.

1.6.1.0

Shuffled a few things around so that the creation order defines the layering, rather than relying on uistack(). Added linkprop() and listener to keep axes in sync and to change xseparator if ylim changes.

1.6.0.0

Added options to: overlay a scatter plot of the underlying data, display the sample size in each box, add x-group separators, and add hierarchical labelling. Shuffled outputs slightly. Thanks to Arnold for the suggestions.
Forgot to include tab2box.
Updated image.

1.5.1.0

Fixed bug where x is a cell array of strings.

1.5.0.0

Remove NaN from x data (and corresponding y data).

1.4.1.0

Updated documentation.

1.4.0.0

Improved robustness to small or empty samples. Add tab2box function for arranging tabular into the format accepted by box_plot.

1.3.0.0

Function now natively supports sub-groups, handles NaNs more robustly, and returns sample size(s). A few other minor tweaks and doc changes.

1.2.0.0

Moved quantile calculation to new function.

1.1.0.0

Changed/corrected quantile estimation algorithm. Details in help text.

1.0.0.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库