create box plots from data
BoxPlot(X, options, plotoptions)
(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
options to be passed to the plots[display] command
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.
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 for the individual boxes. The labels appear along the axes. By default, the labels are 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 is colored with the corresponding color in the list. If a range of colors is given, the colors are generated by selecting an appropriate number of equally spaced points in the corresponding hue range.
If this option is set to true then the deciles are included in the plot. Deciles are represented by points with symbol type set to box. The default value is true.
Initial offset along the x-axis. The default value is 0.
Note: By default, the view wraps tightly around all visible plot objects and the horizontal axis is marked by data set labels, not regular coordinates, so this option will have no (visual) effect. It is meant for the case where this plot is combined with other plot elements.
This option controls the distance between the boxes. The default value is 0.25.
This option controls the width of the boxes. The default value is 0.75.
The following plot illustrates how the options offset, distance, and width are interpreted.
Note the lengths of the arrows labeled "offset", "width", and "distance" correspond to values for the offset, width, and distance options respectively.
mean=true or false
If this option is set to true then the mean is included in the plot. The default value is true.
notched=true or false
Draws notches on box-and-whisker plots. The default is false.
orientation=horizontal or vertical
Indicate the orientation of the box plots. The default is vertical.
outliers=true or false
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 are not included in the plot. In this case, the whiskers are extended past outliers to the maximum and minimum points.
Note that the labels for the data sets are placed on the axes, and should not be confused for coordinates.
A ≔ seq⁡Sample⁡Normal⁡ln⁡i,3,100,i=1..20:
The commands to create the plot from the Plotting Guide are
A ≔ seq⁡Sample⁡Normal⁡ln⁡i,3,10,i=1..3:
BoxPlot⁡A,color=Niagara Green,Niagara Red,Niagara Blue,deciles=false
The BoxPlot command also accepts a Matrix. The columns are understood as individual data samples.
M ≔ Matrix⁡A,scan=columns%T
Plot options such as title are passed to the plots:-display command:
BoxPlot⁡M,color=Niagara Green,deciles=false,title=Box Plots
The Statistics[BoxPlot] command was updated in Maple 2017.
The offset option was updated in Maple 2017.
Download Help Document