Statistics - Maple Programming Help

Home : Support : Online Help : Graphics : Statistics : Statistics/BoxPlot

Statistics

 BoxPlot
 create box plots from data

 Calling Sequence BoxPlot(X, options, plotoptions) BoxPlot['interactive'](X)

Parameters

 X - data options - (optional) equation(s) of the form option=value where option is one of datasetlabels, color, deciles, distance, mean, notched, offset, orientation, outliers, or width; specify options for generating the box plot plotoptions - options to be passed to the plots[display] command

Description

 • The BoxPlot command generates a box plot for the specified data.
 • The first parameter X is either a single data sample - given as e.g. a Vector - or a list of data samples. Note, that the individual samples may be of variable size.
 • If the ['interactive'] option is used, then a dialog box appears that allows for customized creation of the plot.

Options

 The options argument can contain one or more of the options shown below. All unrecognized options will be passed to the plots[display] command. See plot[options] for details.
 • datasetlabels=default or list
 Data set labels to be added to the individual boxes. By default, datasetlabels will be set to 1, 2, 3, etc.
 • color=name, list, or range
 This option specifies colors for the individual data sets. When a list of colors is given, each of the boxes will be colored with the corresponding color in the list. If a range of colors is given, the colors will be generated by selecting an appropriate number of equally-spaced points in the corresponding hue range.
 • deciles=truefalse
 If this options is set to true then the deciles will be included in the plot. Deciles are represented by points with symbol type set to BOX. The default value is true.
 • distance=nonnegative
 This option can be used to control the distance between the boxes. The default value is 0.25.
 • mean=truefalse
 If this options is set to true then the mean will be included in the plot. The default value is true.
 • notched=truefalse
 Draws notches on box-and-whisker plots. The default is false.
 • offset=realcons
 Initial offset along the x-axis.
 • orientation=horizontal, or vertical
 Indicate the orientation of the box plots. The default is vertical.
 • outliers=truefalse
 Outliers are points that are farther than 3/2 times the interquartile range away from the upper and lower quartiles. If this option is set to false, then the outlying points will not be included in the plot. In this case, the whiskers will be extended past outliers to the maximum and minimum points.
 • width=realcons
 This option can be used to control the width of the boxes. The default value is 0.75.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $A≔\left[\mathrm{seq}\left(\mathrm{Sample}\left(\mathrm{Normal}\left(\mathrm{ln}\left(i\right),3\right),100\right),i=1..20\right)\right]:$
 > $\mathrm{BoxPlot}\left(A,\mathrm{title}="Box Plot",\mathrm{deciles}=\mathrm{false}\right)$

The commands to create the plot from the Plotting Guide are

 > $A≔\left[\mathrm{seq}\left(\mathrm{Sample}\left(\mathrm{Normal}\left(\mathrm{ln}\left(i\right),3\right),10\right),i=1..3\right)\right]:$
 > $\mathrm{BoxPlot}\left(A,\mathrm{color}="Niagara Green",\mathrm{deciles}=\mathrm{false}\right)$

The BoxPlot command also accepts a Matrix. The columns are understood as individual data samples.

 > $M≔{\mathrm{Matrix}\left(A,\mathrm{scan}=\mathrm{columns}\right)}^{\mathrm{%T}}$
 ${M}{≔}\left[\begin{array}{ccc}{3.10877128805934}& {-}{3.89128958678925}& {-}{2.48707437881882}\\ {1.31752152546282}& {-}{0.907628020050668}& {4.14268779381371}\\ {3.14480204850343}& {-}{1.12674742965354}& {-}{0.528706955826417}\\ {4.10044760951269}& {-}{0.495286828511537}& {2.07714792683957}\\ {-}{0.322193336445920}& {0.476671533218643}& {0.151887565033526}\\ {-}{1.09803435533570}& {2.06773700903037}& {-}{0.666056518176296}\\ {0.0386725431053459}& {1.71608547705352}& {-}{0.272011208070069}\\ {-}{1.82585486573820}& {4.99007622423190}& {6.06975679738509}\\ {-}{0.0232227788063440}& {-}{0.649972865389813}& {3.35714051501323}\\ {2.31014835660853}& {1.20764950426442}& {-}{1.51175492033557}\end{array}\right]$ (1)

Plot options such as background color are passed to the plots:-display command:

 > $\mathrm{BoxPlot}\left(M,\mathrm{color}="Niagara Green",\mathrm{deciles}=\mathrm{false},\mathrm{background}="LightGrey"\right)$
 >