4.7 | 4 ratings Rate this file 120 Downloads (last 30 days) File Size: 4.96 KB File ID: #42470
image thumbnail

Box and whiskers plot (without statistics toolbox)



Creates nice boxplots from data. You don't need a toolbox. Simple yet fully featured.

| Watch this File

File Information

This function will create a nice boxplot from a set of data. You don't
need a toolbox.

    bplot(D) will create a boxplot of data D, no fuss.

T = bplot(D) If X is a matrix, there is one box per column; if X is a
              vector, there is just one box. On each box, the central
              mark is the median, the edges of the box are the 25th and
              75th percentiles
              array 'T' for a legend. You can add the legend as legend(T)

T = bplot(D,x) will plot the boxplot of data D above the 'x' value x

T = bplot(D,y,'horiz') will plot a horizontal boxplot at the 'y' value of y

T = bplot(...,'Property', . . . )
T = bplot(...,'PropertyName',PropertyValue, . . . )

% Jitter feature
The boxplot has a cool jitter feature which will help you view each
outlier separately even if two have identical values. It jitters the
points around the other axis so that you can see exactly how many are

% Examples:
X = round(randn(30,4)*5)/5; % random, with some duplicates
T = bplot(X,'points');

% This function was created for inclusion in my larger nhist function.


Simple Box Whiskers Plot (For Those Who Don't Have The Statistics Toolbox) inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
21 Apr 2015 Fatzo

Fatzo (view profile)

It's very useful. Is there any way to display values on every plot please?

Comment only
09 Jan 2015 Gavin

Gavin (view profile)

Easy to produce plots that communicate results well

09 Jan 2015 Gavin

Gavin (view profile)

15 Oct 2014 Tim

Tim (view profile)

Exactly what I've been looking for. Love the simplicity of the features!

09 Jul 2014 Udit Gupta

It's quite useful. Wish there was a way to perform the analysis when the number of observations for each experiment are not the same.

Contact us