({{, (RefLink[DistributionChart, paclet:ref/DistributionChart])[{(Subscript[data, 1]),(Subscript[data, 2]),…}] 
makes a distribution chart with a distribution symbol for each (Subscript[data, i]).}, {, (RefLink[DistributionChart, paclet:ref/DistributionChart])[{…,(Subscript[w, i])[(Subscript[data, i]),…],…,(Subscript[w, j])[(Subscript[data, j]),…],…}]
makes a distribution chart with symbol features defined by the symbolic wrappers (Subscript[w, k]).}, {, (RefLink[DistributionChart, paclet:ref/DistributionChart])[{{(Subscript[data, 1]),(Subscript[data, 2]),…},…}]
makes a distribution chart from multiple groups of datasets {(Subscript[data, 1]),(Subscript[data, 2]),…}.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[DistributionChart, paclet:ref/DistributionChart]) draws a representation of the distribution of values in each (Subscript[data, i]).

Data elements for (RefLink[DistributionChart, paclet:ref/DistributionChart]) can be given in the following forms:

Each (Subscript[data, i]) should be a list of real numbers {(Subscript[y, 1]),(Subscript[y, 2]),…}. Elements (Subscript[y, j]) that are not real numbers are taken to be missing and are excluded. If (Subscript[data, i]) is not a list of real numbers, it is taken to be missing data and will typically result in a gap in the box-and-whisker chart.

Datasets for (RefLink[DistributionChart, paclet:ref/DistributionChart]) can be given in the following forms:

Possible symbolic wrappers are the same as for (RefLink[BarChart, paclet:ref/BarChart]) and include (RefLink[Style, paclet:ref/Style]), (RefLink[Labeled, paclet:ref/Labeled]), (RefLink[Legended, paclet:ref/Legended]), etc.

(RefLink[DistributionChart, paclet:ref/DistributionChart]) has the same options as (RefLink[Graphics, paclet:ref/Graphics]), with the following additions and changes:

Possible settings for (RefLink[ChartLayout, paclet:ref/ChartLayout]) include "Grouped" and "Overlapped".

The arguments supplied to (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]) are the box region {{(Subscript[x, min]),(Subscript[x, max])},{(Subscript[y, min]),(Subscript[y, max])}}, the data vector (Subscript[vec, i]), and metadata {(Subscript[m, 1]),(Subscript[m, 2]),…} from each level in a nested list of datasets.

A list of built-in settings for (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]) can be obtained from ChartElementData["DistributionChart"].

With (RefLink[ScalingFunctions, paclet:ref/ScalingFunctions])->s, the data coordinate is scaled using s.

Style and other specifications from options and other constructs in (RefLink[DistributionChart, paclet:ref/DistributionChart]) are effectively applied in the order (RefLink[ChartStyle, paclet:ref/ChartStyle]), (RefLink[Style, paclet:ref/Style]) and other wrappers, and (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]), with later specifications overriding earlier ones.

OpenersPrimaryExamplesSection(Spacer1)Examples  (85)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Generate a distribution chart of a list of datasets:

DistributionChart[RandomReal[BetaDistribution[2,1/4],{6,100}]]

Multiple list of datasets:

data=Table[RandomVariate[BetaDistribution[2,RandomReal[]],100],{4},{2}];

DistributionChart[data]

Use categorical labels:

data=Table[RandomVariate[NormalDistribution[RandomInteger[5],1],100],{2},{3}];

DistributionChart[data,ChartLabels->{"a","b","c"}]

Categorical legends:

DistributionChart[data,ChartLegends->{"a","b","c"}]

Style the shapes:

data=Table[RandomVariate[NormalDistribution[RandomInteger[5],1],100],{10}];

DistributionChart[data,ChartStyle->"SandyTerrain"]

Use procedural shapes:

DistributionChart[data,ChartStyle->"SouthwestColors",ChartElementFunction->"GlassQuantile"]

Histogram bars:

DistributionChart[data,ChartStyle->"SouthwestColors", ChartElementFunction->"HistogramDensity"]

OpenersExampleSection1(Spacer1)Scope  (34)

OpenersExampleSubsection0(Spacer1)Data and Layouts  (17)

Single data vector:

DistributionChart[RandomReal[NormalDistribution[],{1,100}]]

Multiple data vectors:

DistributionChart[RandomReal[NormalDistribution[],{3,100}]]

Data vectors in a dataset are grouped together:

data=RandomVariate[NormalDistribution[0,1],100];

DistributionChart[{{data,data+1,data+2},{data,data+1,data+2}}]

Datasets do not need to have the same number of data vectors:

data=RandomVariate[NormalDistribution[0,1],100];

DistributionChart[{{data,data+1},{data,data+1,data+2,data+3}}]

Nonreal data is taken to be missing and typically yields a gap in the box-and-whisker chart:

data=RandomVariate[NormalDistribution[0,1],100];

DistributionChart[{data,Missing[],data,foo,data},BarSpacing->3]

Nonreal entries in data vectors are omitted:

DistributionChart[{I,1,2,Missing[],3,4,foo,5},BarSpacing->3]

The data may include units:

DistributionChart[{(QuantityUnit[33]),(QuantityUnit[35]),(QuantityUnit[12]),(QuantityUnit[8]),(QuantityUnit[50]),(QuantityUnit[15]),(QuantityUnit[24]),(QuantityUnit[44]),(QuantityUnit[4]),(QuantityUnit[37])},FrameLabel->Automatic]

Specify the units to use:

DistributionChart[{(QuantityUnit[33]),(QuantityUnit[35]),(QuantityUnit[12]),(QuantityUnit[8]),(QuantityUnit[50]),(QuantityUnit[15]),(QuantityUnit[24]),(QuantityUnit[44]),(QuantityUnit[4]),(QuantityUnit[37])},FrameLabel->Automatic,TargetUnits->"Feet"]

The time stamps in (RefLink[TimeSeries, paclet:ref/TimeSeries]), (RefLink[EventSeries, paclet:ref/EventSeries]), and (RefLink[TemporalData, paclet:ref/TemporalData]) are ignored:

d=RandomVariate[NormalDistribution[],100];

DistributionChart[TimeSeries[d,{"May 24, 1982"}]]

The values in associations are taken as the heights of the bars:

d1=RandomVariate[NormalDistribution[0,1],100];
d2=RandomVariate[NormalDistribution[2,0.5],100];

DistributionChart[<|"a"->d1,"b"->d2,"c"->d1+d2|>]

Use the keys as labels:

DistributionChart[<|"a"->d1,"b"->d2,"c"->d1+d2|>,ChartLabels->Automatic]

Use the keys as legends:

DistributionChart[<|"a"->d1,"b"->d2,"c"->d1+d2|>,ChartLegends->Automatic,ChartStyle->82]

Associations can be nested:

a1=RandomVariate[NormalDistribution[0,2],100];
a2=RandomVariate[NormalDistribution[2,1/2],100];
b1=RandomVariate[ChiDistribution[1],100];
b2=RandomVariate[ChiDistribution[3],100];

DistributionChart[<|"group a"-><|"a"->a1,"b"->a2,"c"->a1+a2|>,"group b"-><|"a"->b1,"b"->b2,"c"->b1+b2|>|>,ChartLegends->Automatic,ChartLabels->{Automatic,None}]

Use (RefLink[WeightedData, paclet:ref/WeightedData]) to add weights to data:

data=RandomReal[{-1,1},100];

wd=WeightedData[data,data^2]

DistributionChart[{data,wd}]

Use (RefLink[EventData, paclet:ref/EventData]) to add censoring and truncation information:

event=EventData[data,Round[data]]

DistributionChart[{data,event}]

Use wrappers on individual data vectors, datasets, or collections of datasets:

d=RandomVariate[NormalDistribution[0,1],100];

{DistributionChart[{{d,Style[d+1,Red],d+2},{d,d+1,d+2}}],
DistributionChart[{Style[{d,d+1,d+2},Green],{d,d+1,d+2}}],
DistributionChart[Style[{{d,d+1,d+2},{d,d+1,d+2}},Blue]]}

Inner wrappers take precedence over outer wrappers:

d=RandomVariate[NormalDistribution[0,1],100];

{DistributionChart[{{d,Style[d+1,Red],d+2},{d,d+1,d+2}}],
DistributionChart[{Style[{d,Style[d+1,Red],d+2},Green],{d,d+1,d+2}}],
DistributionChart[Style[{Style[{d,Style[d+1,Red],d+2},Green],{d,d+1,d+2}},Blue]]}

Override the default tooltips:

d=RandomVariate[NormalDistribution[0,1],100];

DistributionChart[{d,Tooltip[d+1,"μ = 1"],d+2}]

Use (RefLink[PopupWindow, paclet:ref/PopupWindow]) to provide additional drilldown information:

d=RandomVariate[NormalDistribution[0,1],100];

DistributionChart[{d,PopupWindow[d+1,BoxWhiskerChart[d+1]],d+2}]

Use the other charting functions in a (RefLink[PopupWindow, paclet:ref/PopupWindow]) to provide more information:

DistributionChart[Table[PopupWindow[FinancialData[f, {{2010,1},{2010,6}}],TradingChart[{f,{{2010,1},{2010,6}}},PlotLabel->f]],{f,{"MSFT","ORCL","ADBE"}}]]

(RefLink[Button, paclet:ref/Button]) can be used to trigger any action:

d=RandomVariate[NormalDistribution[0,1],100];

DistributionChart[{d,Button[d+1,Speak["Mean is 1."]],d+2}]

OpenersExampleSubsection1(Spacer1)Styling and Appearance  (9)

Use an explicit list of styles for the shapes:

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,0,4,1}];

DistributionChart[data,ChartStyle->{Blue,Red,Green,Yellow,Brown}]

Use any gradient or indexed color schemes from (RefLink[ColorData, paclet:ref/ColorData]):

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,0,4,1}];

Table[DistributionChart[data,ChartStyle->s],{s,{"Pastel",12}}]

Use color schemes designed for charting:

ColorData["Charting"]

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,0,5,1}];

Table[DistributionChart[data,ChartStyle->s,Frame->False,BarSpacing->0],{s,Take[ColorData["Charting"],9]}]

(RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]) can be used to set an initial style for all chart elements:

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,0,5,1}];

DistributionChart[data,ChartBaseStyle->EdgeForm[Dashed],ChartStyle->45]

(RefLink[Style, paclet:ref/Style]) can be used to override styles:

d[μ_]:=RandomVariate[NormalDistribution[μ,1],100];

DistributionChart[{d[1],d[2],Style[d[3],Red],d[4],d[5]},ChartStyle->45]

Use built-in programmatically generated shapes:

ChartElementData["DistributionChart"]

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,0,5,1}];

Table[DistributionChart[data,ChartStyle->14,ChartElementFunction->cf],{cf,{"Density","HistogramDensity"}}]

For detailed settings, use Palettes ▶ ChartElementSchemes:

DistributionChart[data,ChartStyle->14,ChartElementFunction->ChartElementData["GlassQuantile","Quantile"->9,"QuantileShading"->True]]

Change the origin of shapes:

data=Table[RandomVariate[BetaDistribution[μ,1/4],100],{μ,1,4,1}];

Table[DistributionChart[data, PlotLabel->o,BarOrigin->o], {o,{Bottom, Top, Left, Right}}]

Adjust the spacing between individuals and groups of shapes:

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,{0,1,2}}];

Table[DistributionChart[{data,data},BarSpacing->sp,PlotLabel->sp,ChartStyle->Opacity[0.8]],{sp,{Automatic,{0,1},{-0.3,1}}}]

Use a theme with dark background and high-contrast styles:

data=RandomVariate[NormalDistribution[RandomInteger[5],1],{3,3,100}];

DistributionChart[data,PlotTheme->"Marketing"]

Use a theme with bright colors and grid lines:

DistributionChart[data,PlotTheme->"Business"]

OpenersExampleSubsection2(Spacer1)Labeling and Legending  (8)

Use (RefLink[Labeled, paclet:ref/Labeled]) to add a label to a shape:

d[μ_]:=RandomVariate[NormalDistribution[μ,1],100];

DistributionChart[{d[1],Labeled[d[2],"label"],d[3]}]

Use symbolic positions for label placement:

d[μ_]:=RandomVariate[BetaDistribution[μ,0.5],100];

Table[DistributionChart[{Labeled[d[1],"label",p],d[2],d[3]},PlotLabel->p,Frame->False],{p,{Bottom,Center,Top}}]

Table[DistributionChart[{Labeled[d[1],"label",p],d[2],d[3]},PlotLabel->p,Frame->False],{p,{Before,After,Above,Below}}]

Provide categorical labels for the columns of data:

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,{0,2}},{3}];

DistributionChart[data,ChartLabels->{"c1","c2","c3"}]

For rows of data:

DistributionChart[data,ChartLabels->{{"r1","r2"},None}]

For both:

DistributionChart[data,ChartLabels->{{"r1","r2"},{"c1","c2","c3"}}]

Use (RefLink[Placed, paclet:ref/Placed]) to control the positioning of labels, using the same positions as for (RefLink[Labeled, paclet:ref/Labeled]):

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,{0,2}},{3}];

DistributionChart[data,ChartLabels->{Placed[{"r1","r2"},Above],Placed[{"c1","c2","c3"},Center]}]

Provide value labels for shapes by using (RefLink[LabelingFunction, paclet:ref/LabelingFunction]):

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,{0,2}},{3}];

DistributionChart[data,LabelingFunction->(Placed[Mean[#],Tooltip]&)]

Use (RefLink[Placed, paclet:ref/Placed]) to control placement and formatting:

labeler[v_,{i_,j_},{ri_,cj_}]:=Placed[Row[{ri[[1]],cj[[1]]},","],Center,Rotate[#,Pi/4]&]

DistributionChart[data,ChartLabels->{{"r1","r2"},{"c1","c2","c3"}},LabelingFunction->labeler]

Add categorical legend entries for the columns of data:

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,{0,2}},{3}];

DistributionChart[data,ChartLegends->{"ccc1","ccc2","ccc3"},ChartStyle->"Pastel"]

For a row of data:

DistributionChart[data,ChartLegends->{{"rr1","rr2"},None},ChartStyle->{"Pastel",None}]

Use (RefLink[Legended, paclet:ref/Legended]) to add additional legend entries:

d[μ_]:=RandomVariate[NormalDistribution[μ,1],100];

DistributionChart[{d[1],Legended[d[2],"extra"],d[3]},ChartLegends->{"ccc1","ccc2","ccc3"},ChartStyle->"Pastel"]

DistributionChart[Legended[{d[1],d[2],d[3]},"extra"],ChartLegends->{"ccc1","ccc2","ccc3"},ChartStyle->"Pastel"]

Use (RefLink[Placed, paclet:ref/Placed]) to affect the positioning of legends:

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,{0,2}},{3}];

Table[DistributionChart[data,ChartLegends->Placed[{"ccc1","ccc2","ccc3"},p],ChartStyle->"Pastel"],{p,{Below,Above}}]

OpenersExampleSection2(Spacer1)Options  (39)

OpenersExampleSubsection3(Spacer1)BarOrigin  (1)

Change bar origin:

data=RandomVariate[NormalDistribution[2,1],{6,100}];

DistributionChart[data]

Table[DistributionChart[data,BarOrigin->o,PlotLabel->o],{o,{Bottom,Top,Left,Right}}]

OpenersExampleSubsection4(Spacer1)BarSpacing  (4)

(RefLink[DistributionChart, paclet:ref/DistributionChart]) automatically selects the spacing between bars:

Table[DistributionChart[RandomVariate[NormalDistribution[],{n,100}]],{n,{1,2,4,8}}]

With groups of data:

Table[DistributionChart[RandomVariate[NormalDistribution[],{n,2,100}]],{n,{2,4}}]

Use symbolic spacing:

Table[DistributionChart[RandomVariate[NormalDistribution[],{10,100}],BarSpacing->s,PlotLabel->s],{s,{Tiny,Small,Medium,Large}}]

With groups of data:

Table[DistributionChart[RandomVariate[NormalDistribution[],{3,2,100}],BarSpacing->s, PlotLabel->s],{s,{Tiny,Small,Medium,Large}}]

Use explicit spacing between bars:

Table[DistributionChart[RandomVariate[NormalDistribution[],{10,100}],BarSpacing->s,PlotLabel->s],{s,{0.25,0.5,1,2}}]

With groups of data:

Table[DistributionChart[RandomVariate[NormalDistribution[],{4,2,100}],BarSpacing->s,PlotLabel->s],{s,{{0.25,0.5},{0,1}}}]

Use no bar spacing:

DistributionChart[RandomVariate[NormalDistribution[],{10,100}],BarSpacing->None]

Within groups of data:

DistributionChart[RandomVariate[NormalDistribution[],{3,2,100}],BarSpacing->{None,1}]

OpenersExampleSubsection5(Spacer1)ChartBaseStyle  (3)

Use (RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]) to style box-and-whisker plots:

Table[DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartBaseStyle->s],{s,{Orange,EdgeForm[],EdgeForm[Thickness[0.01]],Directive[Green, EdgeForm[Thick]]}}]

(RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]) combines with (RefLink[ChartStyle, paclet:ref/ChartStyle]):

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartStyle->24,ChartBaseStyle->EdgeForm[Thick]]

(RefLink[ChartStyle, paclet:ref/ChartStyle]) may override settings for (RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]):

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartStyle->EdgeForm[None],ChartBaseStyle->EdgeForm[Black]]

OpenersExampleSubsection6(Spacer1)ChartElementFunction  (5)

Get a list of built-in settings for (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]):

ChartElementData["DistributionChart"]

For detailed settings, use Palettes ▶ ChartElementSchemes:

data = RandomReal[NormalDistribution[], {5,100}];

Table[DistributionChart[data, ChartElementFunction->f],{f,{"Quantile","DensityQuantile","FadingQuantile","GlassQuantile"}}]

Table[DistributionChart[data,ChartElementFunction->f], {f,{"Density", "HistogramDensity","LineDensity", "PointDensity"}}]

Shade the default violin bars according to density:

DistributionChart[RandomVariate[NormalDistribution[0,1],{8,100}],ChartElementFunction->ChartElementData["SmoothDensity","ColorScheme"->"DeepSeaColors"]]

Use bands to mark decile boundaries:

Table[DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartElementFunction->ChartElementData[f,"QuantileShading"->True,"Quantile"->10]],{f,{"Quantile","DensityQuantile","FadingQuantile","GlassQuantile"}}]

Write a custom (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]):

quantileBead[{{xmin_,xmax_},{ymin_,ymax_}},data_,metadata_]:=Module[{min,max,lq, uq, median},{min,lq, median, uq, max}=Quantile[data,{0,0.1,0.5,0.9,1}];
{Line[{{(xmin+xmax)/2, min}, {(xmin+xmax)/2, max}}],
Polygon[{{xmin, median}, {(xmin+xmax)/2,uq},{xmax,median},{(xmin+xmax)/2,lq}}]}
]

DistributionChart[RandomReal[NormalDistribution[0,1], {3,100}],ChartStyle->14,ChartElementFunction->quantileBead]

OpenersExampleSubsection7(Spacer1)ChartLabels  (8)

By default, labels are placed under the frame:

DistributionChart[RandomReal[NormalDistribution[0,1], {5,100}],ChartLabels->{"a","b","c","d","e"}]

Use (RefLink[Placed, paclet:ref/Placed]) to control label placement:

Table[DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->Placed[{"a","b","c","d","e"},p], PlotLabel->p],{p,{Bottom, Top, Left, Right}}]

Symbolic positions outside the bar:

Table[DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartLabels->Placed[{"a","b","c","d","e"},p], PlotLabel->p],{p,{Below, Above}}]

Table[DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartLabels->Placed[{"a","b","c","d","e"},p],BarOrigin->Left, PlotLabel->p],{p,{Before,After}}]

Use group labels to label groups:

DistributionChart[RandomVariate[NormalDistribution[],{4,2,100}],ChartLabels->{{"g1","g2","g3","g4"},{"a","b"}}]

Coordinate-based placement relative to a bar:

Table[DistributionChart[RandomVariate[NormalDistribution[],{4,2,100}],ChartLabels->Placed[Range[3],p], PlotLabel->p],{p,{{0,0},{0.5,0.5},{1,1}}}]

Place all labels at the upper-right corner and vary the coordinates within the label:

Table[DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->Placed[{"a","b","c","d","e"},{{1,1},p},Framed], PlotLabel->p,Frame->{{True,False},{True,False}}],{p,{{0,0},{0.5,0.5},{1,1}}}]

Use the third argument to (RefLink[Placed, paclet:ref/Placed]) to control formatting:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->Placed[{"a","b","c","d","e"},Axis,Rotate[#,45Degree]&]]

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->Placed[{"a","b","c","d","e"},Axis,Panel]]

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->Placed[{"a","b","c","d","e"},Axis,Style[Framed[#],16,Blue]&]]

Place multiple labels:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],Frame->False,ChartLabels->Placed[{{"a","b","c","d","e"},{"v","w","x","y","z"}},{Above,Below}]]

OpenersExampleSubsection8(Spacer1)ChartLayout  (2)

(RefLink[ChartLayout, paclet:ref/ChartLayout]) is grouped by default:

data=RandomVariate[NormalDistribution[0,1],{2,3,100}];

DistributionChart[data]

Use overlapped layout:

DistributionChart[RandomVariate[NormalDistribution[0,1],{4,2,100}],ChartLayout->"Overlapped",ChartBaseStyle->Opacity[0.3]]

OpenersExampleSubsection9(Spacer1)ChartLegends  (1)

Generate a legend based on chart style:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartStyle->"SandyTerrain", ChartLegends->{"a","b","c","d","e"}]

Use (RefLink[Placed, paclet:ref/Placed]) to change the legend location:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartStyle->"SandyTerrain", ChartLegends->Placed[{"a","b","c","d","e"},Below]]

OpenersExampleSubsection10(Spacer1)ChartStyle  (4)

Use (RefLink[ChartStyle, paclet:ref/ChartStyle]) to style the bars:

Table[DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartStyle->s],{s, {Orange,EdgeForm[Dashed],FaceForm[], Directive[EdgeForm[{Cyan,Thick}],Gray]}}]

Give a list of styles:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartStyle->{Red, Orange, Yellow, Green, Blue}]

Use the "Gradients" color scheme from (RefLink[ColorData, paclet:ref/ColorData]):

DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartStyle->"SolarColors"]

Use the "Indexed" color scheme from (RefLink[ColorData, paclet:ref/ColorData]):

DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartStyle->24]

Styles are used cyclically:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}], ChartStyle->{Red,Blue}]

Style datasets in a group:

DistributionChart[RandomVariate[NormalDistribution[],{4,3,100}], ChartStyle->{Red,Orange,Yellow}]

Style groups of datasets:

DistributionChart[RandomVariate[NormalDistribution[],{4,3,100}], ChartStyle->{{Red,Orange,Yellow,Brown},None}]

OpenersExampleSubsection11(Spacer1)LabelingFunction  (2)

By default, bars have tooltips with a summary table of the data:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}]]

Define a labeling function and place it in the tooltip:

label[data_, index_, label_]:=Grid[{{"Case:", index[[2]]},{"Year:", label[[2,1]]},{"μ:", Mean[data]}},Alignment->{{Right,Left}}]

DistributionChart[RandomVariate[NormalDistribution[],{5,100}], LabelingFunction->(Placed[label[##],Tooltip]&), ChartLabels->Placed[Range[2005, 2009], None]]

OpenersExampleSubsection12(Spacer1)LabelingSize  (4)

Textual labels are shown at their actual sizes:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->{"healthfulness","obstreperous","spectrogram","vestige","coinage","limey"}]

Image labels are automatically resized:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->Placed[{,,,,},Axis]]

Specify a maximum size for textual labels:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->{"healthfulness","obstreperous","spectrogram","vestige","coinage","limey"},LabelingSize->50]

Specify a maximum size for image labels:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->{,,,,},LabelingSize->30]

Show image labels at their natural sizes:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],ChartLabels->{,,,,},LabelingSize->Full,ImageSize->Medium]

OpenersExampleSubsection13(Spacer1)Method  (1)

Use bar widths proportional to the square root of the data sizes:

data=Table[RandomReal[NormalDistribution[],i],{i,{100,400, 900, 1600}}];

DistributionChart[data, Method->{"BoxWidth"->"Scaled"}, ChartLabels->Length/@data]

Put bars on fixed positions with varying bar spacing:

DistributionChart[data, Method->{"BoxWidth"->"Scaled"}, ChartLabels->Length/@data, "EqualSpacing"->False]

Use constant width bars:

DistributionChart[data, Method->{"BoxWidth"->"Fixed"}]

OpenersExampleSubsection14(Spacer1)PerformanceGoal  (3)

Generate a distribution chart with interactive highlighting:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],PerformanceGoal->"Quality"]

Emphasize performance by disabling interactive behaviors:

DistributionChart[RandomVariate[NormalDistribution[],{5,100}],PerformanceGoal->"Speed"]

Typically, less memory is required for non-interactive charts:

Table[ByteCount@DistributionChart[RandomVariate[NormalDistribution[],{5,100}],PerformanceGoal->p], {p,{"Quality","Speed"}}]

OpenersExampleSubsection15(Spacer1)PlotTheme  (1)

Use a theme with bright colors and grid lines:

data=RandomVariate[NormalDistribution[RandomInteger[5],1],{3,3,100}];

DistributionChart[data,PlotTheme->"Business"]

Add a theme with frame and vertical lines:

DistributionChart[data,PlotTheme->{"Business","FrameGrid"}]

Change the grid lines style:

DistributionChart[data,PlotTheme->{"Business","FrameGrid"},GridLinesStyle->LightRed]

OpenersExampleSection3(Spacer1)Applications  (2)

Compare the distribution of salaries for several departments at a university:

salaries=ExampleData[{"Statistics","UniversitySalaries"},"DataElements"];
depts={"Mathematics","History","English","Chemistry","Law","Physics","Statistics"};
data=Table[Cases[salaries,{d,_,salary_,"A"}:>salary],{d,depts}];
all=Cases[salaries,{_,_,salary_,"A"}:>salary];

DistributionChart[data,ChartLabels->Placed[{depts,Length/@data},{Axis,Center}],ChartStyle->54,GridLines->{{{Median[all],Gray}},None},BarOrigin->Left]

Compare different time slices for a random process:

data=Table[RandomVariate[WienerProcess[2,3][t],10^3],{t,{1,4,7,10,13}}];

DistributionChart[data,ChartLabels->{1,4,7,10,13}]

OpenersExampleSection4(Spacer1)Properties & Relations  (6)

Use (RefLink[BoxWhiskerChart, paclet:ref/BoxWhiskerChart]) to show the distribution of data:

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,0,4,1}];

BoxWhiskerChart[data,ChartStyle->14]

(RefLink[BoxWhiskerChart, paclet:ref/BoxWhiskerChart]) is a special case of (RefLink[DistributionChart, paclet:ref/DistributionChart]):

data=Table[RandomVariate[NormalDistribution[μ,1],100],{μ,0,4,1}];

DistributionChart[data,ChartStyle->14,ChartElementFunction->"BoxWhisker"]

Use (RefLink[Histogram, paclet:ref/Histogram]) and (RefLink[SmoothHistogram, paclet:ref/SmoothHistogram]) to visualize lists of data vectors:

data=Table[RandomVariate[NormalDistribution[μ,1],200],{μ,0,8,4}];

{Histogram[data,Automatic,"PDF"],SmoothHistogram[data]}

The default shapes used by (RefLink[DistributionChart, paclet:ref/DistributionChart]) are effectively generated using (RefLink[SmoothHistogram, paclet:ref/SmoothHistogram]):

data=RandomVariate[NormalDistribution[],25];

{DistributionChart[data,BarOrigin->Left],SmoothHistogram[data]}

Use (RefLink[QuantilePlot, paclet:ref/QuantilePlot]) and (RefLink[ProbabilityPlot, paclet:ref/ProbabilityPlot]) to compare data to distributions:

data=RandomVariate[NormalDistribution[0,1],200];

{QuantilePlot[data],ProbabilityPlot[data]}

Use (RefLink[Histogram3D, paclet:ref/Histogram3D]) and (RefLink[SmoothHistogram3D, paclet:ref/SmoothHistogram3D]) to visualize 2D data:

data=RandomVariate[NormalDistribution[2,1],{200,2}];

{Histogram3D[data],SmoothHistogram3D[data]}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[BoxWhiskerChart, paclet:ref/BoxWhiskerChart])  ▪  (RefLink[Histogram, paclet:ref/Histogram])  ▪  (RefLink[QuantilePlot, paclet:ref/QuantilePlot])  ▪  (RefLink[BarChart, paclet:ref/BarChart])  ▪  (RefLink[ListLinePlot, paclet:ref/ListLinePlot])  ▪  (RefLink[Quantile, paclet:ref/Quantile])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Statistical Visualization, paclet:guide/StatisticalVisualization])}, {▪(RefLinkPlain[Random Variables, paclet:guide/RandomVariables])}})}})