Statistics
BoxPlot
create box plots from data
Calling Sequence
Parameters
Description
Options
Notes
Examples
Compatibility
BoxPlot(X, options, plotoptions)
BoxPlot['interactive'](X)
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
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.
deciles=truefalse
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.
offset=realcons
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.
distance=nonnegative
This option controls the distance between the boxes. The default value is 0.25.
width=realcons
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.
with⁡Statistics:
A≔seq⁡Sample⁡Normal⁡ln⁡i,3,100,i=1..20:
BoxPlot⁡A,title=Box Plot,deciles=false
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
M≔−6.150264593360583.923710131011624.18656682418225−4.75323429938184−2.377267832525691.800917449934370.4376784546134283.85224337559343−2.149730185201152.302622904471493.378298806149743.569487595159313.982561420653237.66312008588142−3.07100377513460−1.16195228843286−1.17658650278167−2.68832699450844−0.8012787318286431.401481332390683.78537967747607−0.8963384230313104.695547171109091.068259111325015.485079603389111.744663787330163.375076410166781.060422550495190.06009283379614853.55227242615577
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.
See Also
plot/options
Statistics/Visualization
Statistics[AreaChart]
Statistics[LineChart]
Statistics[PointPlot]
Statistics[ViolinPlot]
Download Help Document