Statistics Toolbox | ![]() ![]() |
Syntax
boxplot(X) boxplot(X,notch) boxplot(X,notch,'sym
') boxplot(X,notch,'sym
',vert) boxplot(X,notch,'sym
',vert,whis)
Description
boxplot(X)
produces a box and whisker plot for each column of X
. The box has lines at the lower quartile, median, and upper quartile values. The whiskers are lines extending from each end of the box to show the extent of the rest of the data. Outliers are data with values beyond the ends of the whiskers. If there is no data outside the whisker, a dot is placed at the bottom whisker.
boxplot(X,notch)
with notch
=
1
produces a notched-box plot. Notches graph a robust estimate of the uncertainty about the means for box-to-box comparison. The default, notch =
0
, produces a rectangular box plot.
boxplot(X,notch,'
where sym
')
sym
is a plotting symbol, affords control of the symbol for outliers. The default is '+'
. See MATLAB's LineSpec
property for information about the available marker symbols.
boxplot(X,notch,'
with vert sym
',vert)
=
0
creates horizontal boxes rather than the default vertical boxes (vert =
1
).
boxplot(X,notch,'
enables you to specify the length of the "whiskers." whis defines the maximum length of the whiskers as a function of the inter-quartile range (default = 1.5 * IQR). Each whisker extends to the most extreme data value within sym
',vert,whis)
whis
*IQR of the box. If whis =
0
, then boxplot displays all data values outside the box using the plotting symbol, 'sym
'.
Examples
x1 = normrnd(5,1,100,1); x2 = normrnd(6,1,100,1); x = [x1 x2]; boxplot(x,1)
The difference between the means of the two columns of x
is 1. We can detect this difference graphically by observing that the notches in the boxplot do not overlap.
See Also
![]() | bootstrp | capable | ![]() |