This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

BoxWhiskerChart

BoxWhiskerChart
makes a box-and-whisker chart for the values .
BoxWhiskerChart
makes a chart with box-and-whisker symbol specification bwspec.
BoxWhiskerChart
makes a chart with box-and-whisker symbol for each .
BoxWhiskerChart
makes a box-and-whisker chart from multiple groups of datasets .
  • BoxWhiskerChart draws a box-and-whisker summary of the distribution of values in each .
  • The following box-and-whisker specifications bwspec can be given:
"Notched"median confidence interval notch
"Outliers"outlier markers
"Median"median marker
"Basic"box-and-whisker only
"Mean"mean marker
"Diamond"mean confidence interval diamond
{{elem1,val11,...},...}box-and-whisker element specification
{"name",{elem1,val11,...},...}named bwspec with element modifications
  • The elements and values include:
{"Fences",width,style}width and style of fences
{"MeanDiamond",width,style}width and style of mean confidence interval
{"MeanMarker",width,style}width and style of mean marker line
{"MedianNotch",width,style}width and style of median confidence interval
{"MedianMarker",width,style}width and style of median marker line
{"Outliers",marker,style}marker symbol and style for outliers
{"FarOutliers",marker,style}marker symbol and style for far outliers
{"Whiskers",style}style for whiskers
  • The width is given as a fraction of the width of the box, and the marker can be any expression.
dataia pure dataset
wi[datai,...]data with wrapper
formi->midata with metadata
  • Each should be a list of real numbers . Elements that are not real numbers are taken to be missing and are excluded. If is not a list of real numbers it is taken to be missing data and will typically result in the gap in the box-and-whisker chart.
{data1,data2,...}list of elements with or without wrappers
w[{data1,data2,...},...]wrapper applied to a grouped dataset
w[{{data1,data1,...},...},...]wrapper applied to all grouped datasets
Top,Bottom,Left,Right,Centerpositions within the box
Above, Below, Before, Afterpositions outside the box and other elements
Axison the bar origin axis
"LowerFence","LowerQuartile","MedianMarker","MeanMarker","UpperQuartile","UpperFence"positions given by box-and-whisker elements
{{bx,by},{lx,ly}}scaled position in the label at scaled position for the box-and-whisker elements
AspectRatio1/GoldenRatiooverall ratio of width to height
AxesTruewhether to draw axes
BarOriginBottomwhere to place smallest value for box-and-whisker
BarSpacingAutomaticfractional spacing between box-and-whiskers
ChartBaseStyleAutomaticoverall style for box-and-whiskers
ChartElementFunctionAutomatichow to generate raw graphics for box
ChartLabelsNonelabels for data elements and datasets
ChartLegendsNonelegends for data elements and datasets
ChartStyleAutomaticstyle for box
JoinedFalsewhether to join medians
LabelingFunctionAutomatichow to label box-and-whisker elements
LegendAppearanceAutomaticoverall appearance of legends
MethodAutomaticwhat methods to use
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
ScalingFunctionsNonehow to scale individual coordinates
  • The arguments supplied to ChartElementFunction are the box region , the data , and metadata from each level in a nested list of datasets.
Generate a box-and-whisker chart for a data vector:
Generate a box-and-whisker chart for a list of data vectors:
Chart several collections of datasets:
Customize the appearance of the box-and-whisker chart:
Show outliers:
Use categorical labels:
Categorical legends:
Show outliers:
Show notches for the median confidence interval:
Generate a box-and-whisker chart for a data vector:
In[1]:=
Click for copyable input
Out[1]=
 
Generate a box-and-whisker chart for a list of data vectors:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
 
Chart several collections of datasets:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
 
Customize the appearance of the box-and-whisker chart:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Show outliers:
In[3]:=
Click for copyable input
Out[3]=
 
Use categorical labels:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Categorical legends:
In[3]:=
Click for copyable input
Out[3]=
 
Show outliers:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Show notches for the median confidence interval:
In[3]:=
Click for copyable input
Out[3]=
Single data vector:
Multiple data vectors:
Data vectors in a dataset are grouped together:
Datasets do not need to have the same number of data vectors:
Nonreal data is taken to be missing and typically yields a gap in the box-and-whisker chart:
A nonreal entry in a data vector is omitted:
Use wrappers on an individual data vector, datasets, or collections of datasets:
Override the default tooltips:
Use PopupWindow to provide additional drilldown information:
Use the other charting function in PopupWindow to provide more information:
Button can be used to trigger any action:
Use named presets:
Style the whiskers:
Vary the width of the fences:
Style the fences:
Use different shapes for outliers:
Style the outliers:
Use different shapes for far outliers:
Style the far outliers:
Vary the width of the median marker:
Style the median marker:
Use a different shape of median marker:
Do not show the median marker:
Vary the width of the median confidence interval:
Style the median confidence interval:
Vary the width of the mean marker:
Style the mean marker:
Use a different shape of mean marker:
Vary the width of the mean confidence interval:
Style the mean confidence interval:
Combine individual elements with named presets:
Combine elements with ChartElementFunction:
Use an explicit list of styles for the box-and-whiskers:
Use any gradient or indexed color schemes from ColorData:
Use color schemes designed for charting:
ChartBaseStyle can be used to set an initial style for all chart elements:
Style can be used to override styles:
Use built-in programmatically generated bars:
For detailed settings use PalettesChartElementSchemes:
Change the origin of box-and-whiskers:
Adjust the spacing between individuals and groups of box-and-whiskers:
Use Labeled to add a label to a box-and-whisker:
Use symbolic positions for label placement:
Provide categorical labels for the columns of data:
For rows of data:
For both:
Use Placed to control the positioning of labels, using the same positions as for Labeled:
Provide value labels for box-and-whisker by using LabelingFunction:
Use Placed to control placement and formatting:
Add categorical legend entries for the columns of data:
For rows of data:
Use Legended to add additional legend entries:
Use Placed to affect the positioning of legends:
Change the bar origin:
BoxWhiskerChart automatically selects the spacing between bars:
With groups of data:
Use symbolic spacing:
With groups of data:
Use explicit spacing between bars:
With groups of data:
Use no bar spacing:
Within groups of data:
Use ChartBaseStyle to style box-and-whisker charts:
ChartBaseStyle combines with ChartStyle:
ChartStyle may override settings for ChartBaseStyle:
Get a list of built-in settings for ChartElementFunction:
For detailed settings, use PalettesChartElementSchemes:
Use named specifications with ChartElementFunction:
By default labels are placed under the frame:
Use Placed to control label placement:
Symbolic positions outside the bar:
Use positions relative to the box-and-whisker charts:
Use group labels to label groups:
Coordinate-based placement relative to a bar:
Place all labels at the upper-right corner and vary the coordinates within the label:
Use the third argument to Placed to control formatting:
Place multiple labels:
Generate a legend based on chart style:
Place the legend below the chart:
Use ChartStyle to style the bars:
Give a list of styles:
Use colors from ColorData:
Use colors from ColorData:
Styles are used cyclically:
Style datasets in a group:
Style groups of datasets:
Element styles override ChartStyle:
Join the medians of the datasets:
By default bars have tooltips with a summary table of the data:
Define a labeling function and place it in a tooltip:
Use bar widths proportional to the square root of the data sizes:
Put bars on fixed positions with varying bar spacing:
Use constant-width bars:
Generate a box-and-whisker chart with interactive highlighting:
Emphasize performance by disabling interactive behaviors:
Typically less memory is required for non-interactive charts:
Compare the distribution of salaries for several departments at a university:
A -test for equal location of two populations effectively checks for overlap in confidence intervals about their means. BoxWhiskerChart can be used to perform a visual -test:
The mean diamonds do not overlap. The null hypothesis is rejected at the 5% level:
The mean diamonds overlap. There is not enough evidence to reject the null hypothesis:
Outliers and far outliers are defined using the quartiles and interquartile range:
Use DistributionChart to show distribution of data:
Use Histogram and SmoothHistogram to visualize a list of data vectors:
Use QuantilePlot and ProbabilityPlot to compare data to distributions:
Use Histogram3D and SmoothHistogram3D to visualize two-dimensional data vectors:
New in 8