File Exchange

image thumbnail

boxplot2

version 1.0.0.0 (16.6 KB) by Kelly Kearney
An alternative boxplot function

63 Downloads

Updated 05 Jan 2018

GitHub view license on GitHub

The original boxplot.m function is more heavy-handed than most Matlab plotting functions; it replaces ticks with text labels, changes axis dimensions, etc. This version creates a boxplot with a minimal amount of alteration to existing axes, assuming that any cosmetic changes (color, tick labels, line specs, etc) can be added by the user afterwards if necessary.
Additionally, this function allows one to create clustered boxplots, similar to an unstacked bar graph.

Cite As

Kelly Kearney (2020). boxplot2 (https://github.com/kakearney/boxplot2-pkg), GitHub. Retrieved .

Comments and Ratings (16)

HE

Is there a possibility to add a legend for each group?

Jinping Wan

ting zhu

Jan

Filling the dataset with NaN works as expected.
Thank you Kelley. :-)

@Jan and Peter, This function ignores NaNs, so you could add NaNs to your shorter datasets to allow the concatenation needed for this utility. Or alternatively, perhaps the original boxplot with the group input would better suit your needs.

Jan

Jan

@Peter,
Did you find any solution for your groups with different numbers of observations?
This would be really interesting.

Thanks in advance,
Jan

Ist

Ist

Is there are way to do this for groups with different numbers of observations?

Thanks so much.

Peter

Baijun Wu

Is there a way that I can change the linestyle of the box?Thanks a lot

@Stephanie,

The tick labels can be altered via standard Matlab syntax, e.g.

set(gca, 'xticklabel', '')

will remove remove tick labels. Or you can use a combo of the XTick and XTickLabel properties to assign specific tick locations and labels.

Stephanie

Overall really appreciate this function as it grouped the boxplots exactly as I needed them.

Is there an easy way to get rid of the numeric x labels? It would make more sense to remove them if comparing numerous pair-wise boxplots within the same figure.

Updates

1.0.0.0

Edited title

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

boxplot2

minmax