Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Box plot

`boxplot(x)`

`boxplot(x,g)`

`boxplot(ax,___)`

`boxplot(___,Name,Value)`

`boxplot(`

creates a box plot of the data in
`x`

)`x`

. If `x`

is a vector,
`boxplot`

plots one box. If `x`

is a
matrix, `boxplot`

plots one box for each column of
`x`

.

On each box, the central mark indicates the median, and the bottom and top edges of the box indicate the 25th and 75th percentiles, respectively. The whiskers extend to the most extreme data points not considered outliers, and the outliers are plotted individually using the `'+'`

symbol.

`boxplot(`

creates
a box plot using the axes specified by the axes graphic object `ax`

,___)`ax`

,
using any of the previous syntaxes.

`boxplot(___,`

creates
a box plot with additional options specified by one or more `Name,Value`

)`Name,Value`

pair
arguments. For example, you can specify the box style or order.

`boxplot`

creates a visual representation of the data, but does not return numeric values. To calculate the relevant summary statistics for the sample data, use the following functions:You can see data values and group names using the data cursor (MATLAB) in the figure window. The cursor shows the original values of any points affected by the

`datalim`

parameter. You can label the group to which an outlier belongs using the`gname`

function.To modify graphics properties of a box plot component, use

`findobj`

with the`Tag`

property to find the component's handle.`Tag`

values for box plot components depend on parameter settings, and are listed in the following table.Parameter Settings Tag Values All settings `'Box'`

`'Outliers'`

When `'PlotStyle'`

is`'traditional'`

`'Median'`

`'Upper Whisker'`

`'Lower Whisker'`

`'Upper Adjacent Value'`

`'Lower Adjacent Value'`

When `'PlotStyle'`

is`'compact'`

`'Whisker'`

`'MedianOuter'`

`'MedianInner'`

When `'Notch'`

is`'marker'`

`'NotchLo'`

`'NotchHi'`

[1] McGill, R., J. W. Tukey, and W. A. Larsen. “Variations of Boxplots.” The American Statistician. Vol. 32, No. 1, 1978, pp. 12–16.

[2] Velleman, P.F., and D.C. Hoaglin. Applications, Basics, and Computing of Exploratory Data Analysis. Pacific Grove, CA: Duxbury Press, 1981.

[3] Nelson, L. S. “Evaluating Overlapping Confidence Intervals.” Journal of Quality Technology. Vol. 21, 1989, pp. 140–141.

[4] Langford, E. “Quartiles in Elementary Statistics”, Journal of Statistics Education. Vol. 14, No. 3, 2006.

`anova1`

| `grpstats`

| `kruskalwallis`

| `max`

| `median`

| `min`

| `multcompare`

| `quantile`

Was this topic helpful?