DistributionChart[{data1,data2,…}]
各 dataiに分布記号を使った分布図を作成する.
DistributionChart[{data1,data2,…},elems]
外観要素 elems を使って分布図を作成する.
DistributionChart[{…,wi[datai,…],…,wj[dataj,…],…}]
記号の図形を記号ラッパー wkで定義した分布図を作成する.
DistributionChart[{{data1,data2,…},…}]
複数のデータ集合{data1,data2,…}から分布図を作成する.
DistributionChart
DistributionChart[{data1,data2,…}]
各 dataiに分布記号を使った分布図を作成する.
DistributionChart[{data1,data2,…},elems]
外観要素 elems を使って分布図を作成する.
DistributionChart[{…,wi[datai,…],…,wj[dataj,…],…}]
記号の図形を記号ラッパー wkで定義した分布図を作成する.
DistributionChart[{{data1,data2,…},…}]
複数のデータ集合{data1,data2,…}から分布図を作成する.
詳細とオプション
- DistributionChartはバイオリンプロットとしても知られている.
- DistributionChartは各 dataiの値の分布を表す図を作成する.
- DistributionChartのデータ要素の形式
-
datai 純粋なデータ集合 Quantity[datai,unit] 単位付きのデータ datai wi[datai,…] ラッパー wiのあるデータ veci formi->mi メタデータ miを含むデータ - 各 datai は実数のリスト{y1,y2,…}でなければならない.実数ではない要素 yj は欠測値とみなされ,削除される.datai が実数値のリストでなければ,それは欠測データとみなされ,一般に分布図中の欠落部となる.
- DistributionChartのデータ集合の形式
-
{data1,data2,…} ラッパーがある/ない要素のリスト <|k1data1,k2data2,…|> キーとデータ集合の連想 TimeSeries[…],EventSeries[…],TemporalData[…] 時系列,事象系列,一時データ WeightedData[…],EventData[…] 拡張データ集合 w[{data1,data2,…},…] データ集合群にラッパーを適用 w[{{data1,data1,…},…},…] すべてのデータ集合群にラッパーを適用 - DistributionChart[Tabular[…]cspec]は,列指定 cspec を使って表オブジェクトから値を抽出し,これをプロットする.
- 次は,表データのプロットに使用できる列指定 cspec の形式である.
-
colx 列 colxの値について分布図をプロットする {colx1,colx2,…} 列 colx1, colx2, …について分布図をプロットする - dataiには,以下のラッパーを使うことができる.
-
Annotation[e,label] 注釈を与える Button[e,action] 要素がクリックされたときに実行するアクションを定義する Callout[e,label] コールアウトを付けて要素を表示する EventHandler[e,…] 要素の一般的なイベントハンドラを定義する Hyperlink[e,uri] 要素をハイパーリンクにする Labeled[e,…] 要素にラベルを付けて表示する Legended[e,…] グラフの凡例に要素の特徴を含める Mouseover[e,over] 要素がマウスオーバーされたときの形を表示するようにする PopupWindow[e,cont] 要素にポップアップウィンドウを付ける StatusArea[e,label] 要素がマウスオーバーされたときにステータスエリアに表示する Style[e,opts] 要素を指定のスタイルで表示する Tooltip[e,label] 要素に任意のツールチップを付ける - 可能な外観要素 elems は次の形式でよい.
-
Automatic 自動的な分布外観 "name" 名前付き分布外観"name" {"name",<|"prop1"val1,…|>} 特性 propiが値 valiに設定された名前付き外観 - 指定可能な名前付き要素"name"には以下がある.
- 外観要素に対して一般に使用される特性には以下がある.
-
"Alignment" Center 要素内容をどのように整列するか "BoundaryStyle" Automatic 要素の境界に使用するスタイル "FarOutlier" None 極端な外れ値に使用するスタイル "FillingStyle" Automatic 要素の塗潰しスタイル "LineStyle" None 線要素に使用するスタイル "LineWidth" Automatic 線要素の長さをどのようにするか "Outlier" None 外れ値に使用するスタイル "PointStyle" None データ点に使用するスタイル "PointWidth" Automatic 点要素をどのくらいの幅で配置するか "Quantiles" None 分位線を引く場所 "QuantileShading" None 分位領域に陰影付けを行うかどうか "QuantileStyle" Automatic 分位線に使用するスタイル "Range" Automatic 要素とともに表示する値の範囲 - "Alignment"の可能な設定には,Left,Right,Before,After,Bottom,Top,Below,Above,Centerがある.
- 特性"Outlier"と"FarOutlier"は次の設定を取る.
-
Automatic 外れ値を表示せずに含める None 外れ値を除外する True 外れ値を表示する style スタイル style で外れ値を表示する {marker,style} 外れ値を,マーカー marker,スタイル style で表示する - "LineWidth"および"PointWidth"は,線および点をどの程度の幅の領域内に描画できるかを制御する.設定としては次のものが含まれる.
-
Automatic 線および点を要素の境界内部に制限する All 境界ボックスの幅全体を使用する Scaled[s] 要素の境界ボックスの幅の割合 s を使用する s 境界ボックスの幅の割合 s を使用する - "Quantiles"特性は次の設定を取ることができる.
-
None いかなる分位線も表示しない Automatic 分位線を表示する n n 分位領域を表示する {q1,q2,…} q1,q2,…分位を表示する - 以下の"QuantileShading"設定が使用できる.
-
None 分位領域に陰影を付けない Automatic 分位領域に自動的に陰影を付ける {r1,r2,…} スタイル ri を用いて分位 qi-1と qiの間の領域に陰影を付ける - 特性"Range"は次の設定を取る.
-
All 要素の全範囲を表示する Automatic 要素とともに表示するデータの範囲を自動的に決定する {min,max} min から max までのデータと要素を表示する {Scaled[min],Scaled[max]} min から max までの分位点のデータと要素を表示する - "SmoothHistogram","Violin","Density"の各要素に指定可能な特性には次のものが含まれる.
-
"Kernel" Automatic 平滑化密度カーネル関数 "Bandwidth" Automatic 平滑化密度のバンド幅 - "Kernel"と"Bandwidth"の設定にはSmoothKernelDistributionと同じ設定が使える.
- "Histogram"要素の使用可能な特性には以下がある.
-
"Bins" Automatic ヒストグラムのビン "Height" "PDF" ヒストグラムの高さ関数 - "Bins"と"Height"の設定にはHistogramと同じ設定が使える.
- DistributionChartには,Graphicsのものと同じオプションに以下の追加変更を加えたものが使える. [全オプションのリスト]
-
AspectRatio 1/GoldenRatio 全体的な縦横比 BarOrigin Bottom 図形の始点位置 BarSpacing Automatic 図形間のスペース ChartBaseStyle Automatic 図形の全体的なスタイル ChartElementFunction Automatic 図形に使う生のグラフィックスをどのように生成するか ChartLabels None データ要素とデータ集合のラベル ChartLayout Automatic 使用する全体的なレイアウト ChartLegends None データ要素とデータ集合の凡例 ChartStyle Automatic 図形のスタイル Frame True グラフの周囲に枠を描くかどうか LabelingFunction Automatic 図形にどのようにラベルを付けるか LabelingSize Automatic コールアウトとラベルの最大サイズ LegendAppearance Automatic 凡例の全体的な外観 Method Automatic 使用するメソッド PerformanceGoal $PerformanceGoal パフォーマンスのどの面について最適化するか PlotInteractivity $PlotInteractivity インタラクティブ要素を許可するかどうか PlotTheme $PlotTheme 全体的なグラフのテーマ ScalingFunctions None 個々の座標をどのようにスケールするか TargetUnits Automatic グラフ中に表示する単位 - 複数のデータ集合は,ChartLayoutの以下の設定を使って表示できる.
-

"Grouped" 各データ集合のデータを分離する 
"Overlapped" 各データ集合のデータを重ねる - ChartElementFunctionに渡される引数は,データ集合のネストしたリストの各レベルからの箱の領域{{xmin,xmax},{ymin,ymax}},データベクトル veci,メタデータ {m1,m2,…}である.
- ChartElementFunctionの組込み設定値のリストはChartElementData["DistributionChart"]から得ることができる.
- ScalingFunctions->s とすると,データ座標は s を使ってスケールされる.
- DistributionChartのオプションおよびその他の構造からのスタイルその他の指定は,事実上ChartStyle,Styleその他のラッパー,ChartElementFunctionの順に適用され,後の指定が先の指定に優先する.
全オプションのリスト
例題
すべて開く すべて閉じる例 (4)
DistributionChart[RandomReal[BetaDistribution[2, 1 / 4], {6, 100}]]data = Table[RandomVariate[BetaDistribution[2, RandomReal[]], 100], {4}, {2}];DistributionChart[data]data = Table[RandomVariate[NormalDistribution[RandomInteger[5], 1], 100], {2}, {3}];DistributionChart[data, PlotLabels -> <|"Elements" -> {"a", "b", "c"}|>]DistributionChart[data, PlotLegends -> <|"Elements" -> {"a", "b", "c"}|>]data = Table[RandomVariate[NormalDistribution[RandomInteger[5], 1], 100], {2}, {3}];DistributionChart[data]DistributionChart[data, "Violin"]DistributionChart[data, "Histogram"]スコープ (43)
データとレイアウト (17)
DistributionChart[RandomReal[NormalDistribution[], {1, 100}]]DistributionChart[RandomReal[NormalDistribution[], {3, 100}]]data = RandomVariate[NormalDistribution[0, 1], 100];DistributionChart[{{data, data + 1, data + 2}, {data, data + 1, data + 2}}]data = RandomVariate[NormalDistribution[0, 1], 100];DistributionChart[{{data, data + 1}, {data, data + 1, data + 2, data + 3}}]非実数データは欠測値としてみなされ一般に欠落部として表される:
data = RandomVariate[NormalDistribution[0, 1], 100];DistributionChart[{data, Missing[], data, foo, data}, BarSpacing -> 3]DistributionChart[{I, 1, 2, Missing[], 3, 4, foo, 5}]DistributionChart[{Quantity[33, "Meters"], Quantity[35, "Meters"], Quantity[12, "Meters"], Quantity[8, "Meters"], Quantity[50, "Meters"], Quantity[15, "Meters"], Quantity[24, "Meters"], Quantity[44, "Meters"], Quantity[4, "Meters"], Quantity[37, "Meters"]}, FrameLabel -> Automatic]DistributionChart[{Quantity[33, "Meters"], Quantity[35, "Meters"], Quantity[12, "Meters"], Quantity[8, "Meters"], Quantity[50, "Meters"], Quantity[15, "Meters"], Quantity[24, "Meters"], Quantity[44, "Meters"], Quantity[4, "Meters"], Quantity[37, "Meters"]}, FrameLabel -> Automatic, TargetUnits -> "Feet"]TimeSeries,EventSeries,TemporalData中のタイムスタンプは無視される:
d = RandomVariate[NormalDistribution[], 100];DistributionChart[TimeSeries[d, {"May 24, 1982"}]]d1 = RandomVariate[NormalDistribution[0, 1], 100];
d2 = RandomVariate[NormalDistribution[2, 0.5], 100];DistributionChart[<|"a" -> d1, "b" -> d2, "c" -> d1 + d2|>]DistributionChart[<|"a" -> d1, "b" -> d2, "c" -> d1 + d2|>, PlotLabels -> Automatic]DistributionChart[<|"a" -> d1, "b" -> d2, "c" -> d1 + d2|>, PlotLegends -> Automatic, PlotStyle -> {Hue[0.6, 0.7, 0.8], Hue[0.22, 1, 0.7], Hue[0.75, 0.6, 0.7]}]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|>|>, PlotLegends -> Automatic, PlotLabels -> {Automatic, None}]WeightedDataを使ってデータに重みを加える:
data = RandomReal[{-1, 1}, 100];wd = WeightedData[data, data ^ 2]DistributionChart[{data, wd}, PlotLabels -> {"data", "weighted data"}]EventDataを使って打切りと切断の情報を加える:
event = EventData[data, Round[data]]DistributionChart[{data, event}, PlotLabels -> {"data", "censored data"}]個々のデータリスト,データ集合,データ集合のコレクションにラッパーを使う:
d = RandomVariate[NormalDistribution[0, 1], 100];{DistributionChart[{{d, Style[d + 1, RGBColor[0.93, 0.27, 0.27]], d + 2}, {d, d + 1, d + 2}}],
DistributionChart[{Style[{d, d + 1, d + 2}, RGBColor[0.14, 0.8, 0.14]], {d, d + 1, d + 2}}],
DistributionChart[Style[{{d, d + 1, d + 2}, {d, d + 1, d + 2}}, RGBColor[0.4, 0.6, 1]]]}d = RandomVariate[NormalDistribution[0, 1], 100];{DistributionChart[{{d, Style[d + 1, RGBColor[0.93, 0.27, 0.27]], d + 2}, {d, d + 1, d + 2}}],
DistributionChart[{Style[{d, Style[d + 1, RGBColor[0.93, 0.27, 0.27]], d + 2}, RGBColor[0.14, 0.8, 0.14]], {d, d + 1, d + 2}}],
DistributionChart[Style[{Style[{d, Style[d + 1, RGBColor[0.93, 0.27, 0.27]], d + 2}, RGBColor[0.14, 0.8, 0.14]], {d, d + 1, d + 2}}, RGBColor[0.4, 0.6, 1]]]}d = RandomVariate[NormalDistribution[0, 1], 100];DistributionChart[{d, Tooltip[d + 1, "μ = 1"], d + 2}]PopupWindowを使って追加的なドリルダウン情報を入れる:
d = RandomVariate[NormalDistribution[0, 1], 100];DistributionChart[{d, PopupWindow[d + 1, BoxWhiskerChart[d + 1]], d + 2}]PopupWindow中のその他のチャート関数を使ってより多くの情報を与える:
DistributionChart[Table[PopupWindow[FinancialData[f, {{2010, 1}, {2010, 6}}], TradingChart[{f, {{2010, 1}, {2010, 6}}}, PlotLabel -> f]], {f, {"MSFT", "ORCL", "ADBE"}}]]Buttonを使ってアクションを起すことができる:
d = RandomVariate[NormalDistribution[0, 1], 100];DistributionChart[{d, Button[d + 1, Speak["Mean is 1."]], d + 2}]表形式データ (2)
penguins = ResourceData["Sample Tabular Data: Palmer Penguins"]DistributionChart[penguins -> "flipper_length"]pivot = PivotToColumns[penguins, "species" -> "flipper_length"]DistributionChart[pivot -> {ExtendedKey["flipper_length", "Adelie"], ExtendedKey["flipper_length", "Chinstrap"], ExtendedKey["flipper_length", "Gentoo"]}, PlotLabels -> {"Adelie", "Chinstrap", "Gentoo"}]DistributionChart[pivot -> {"Adelie", "Chinstrap", "Gentoo"}, PlotLabels -> {"Adelie", "Chinstrap", "Gentoo"}]外観要素 (9)
平滑化されたヒストグラムを用いて,データ内の値の分布を示す:
DistributionChart[IconizedObject[«data»], "SmoothHistogram"]データ内の値の分布を示すために,左右対称の平滑化ヒストグラムつまりバイオリンを用いる:
DistributionChart[IconizedObject[«data»], "Violin"]DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"Bandwidth" -> 0.1|>}]DistributionChart[IconizedObject[«data»], {"Violin", <|"Kernel" -> "Triangular"|>}]DistributionChart[IconizedObject[«data»], {"Violin", <|"Kernel" -> {"Bounded", 0, "Gaussian"}|>}]DistributionChart[IconizedObject[«data»], "Histogram"]DistributionChart[IconizedObject[«data»], {"Histogram", <|"Bins" -> 5|>}]DistributionChart[IconizedObject[«data»], {"Histogram", <|"Bins" -> {0.5}|>}]DistributionChart[IconizedObject[«data»], "Density"]DistributionChart[IconizedObject[«data»], {"Density", <|"Bandwidth" -> 0.1|>}]DistributionChart[IconizedObject[«data»], {"Density", <|"Kernel" -> "Triangular"|>}]Table[DistributionChart[IconizedObject[«data»], {appearance, <|"LineWidth" -> Automatic|>}, PlotLabel -> appearance], {appearance, {"SmoothHistogram", "Violin", "Density", "Box"}}]Table[DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"LineWidth" -> Scaled[width]|>}, PlotLabel -> width], {width, {0, 0.2, 0.5, 1}}]DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"LineWidth" -> Scaled[1], "LineStyle" -> Directive[RGBColor[0.98, 0.56, 0.17], AbsoluteThickness[1]]|>}]Table[DistributionChart[IconizedObject[«data»], {appearance, <|"PointWidth" -> Automatic|>}, PlotLabel -> appearance], {appearance, {"Violin", "SmoothHistogram", "Histogram", "SymmetricalHistogram", "Density", "Box"}}]Table[DistributionChart[IconizedObject[«data»], {"Violin", <|"PointWidth" -> Scaled[width]|>}, PlotLabel -> Scaled[width]], {width, {0, 0.2, 0.5, 1}}]Table[DistributionChart[IconizedObject[«data»], {"Violin", <|"PointWidth" -> width|>}, PlotLabel -> width], {width, {0, 0.2, 0.5, 1}}]DistributionChart[IconizedObject[«data»], {"Violin", <|"PointWidth" -> Scaled[1], "PointStyle" -> Directive[Opacity[0.75], RGBColor[0.98, 0.56, 0.17], AbsolutePointSize[5]]|>}]Table[DistributionChart[IconizedObject[«data»], {appearance, <|"Quantiles" -> Automatic|>}, PlotLabel -> appearance], {appearance, {"SmoothHistogram", "Violin", "Density", "Box"}}]DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"Quantiles" -> 10|>}]DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"Quantiles" -> {0.1, 0.5, 0.9}|>}]DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"Quantiles" -> 5, "QuantileStyle" -> RGBColor[0.8, 0.3, 0.8]|>}]DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"Quantiles" -> 5, "QuantileShading" -> True|>}]DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"Range" -> {Scaled[0.25], Scaled[0.75]}|>}]DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"Range" -> {-1, 9}|>}]Table[DistributionChart[IconizedObject[«data»], {"SmoothHistogram", <|"Alignment" -> alignment|>}, PlotLabel -> alignment, ImageSize -> 225], {alignment, {Before, After, Left, Right}}]スタイルと外観 (7)
data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, 0, 4, 1}];DistributionChart[data, PlotStyle -> {RGBColor[0.4, 0.6, 1], RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[1, 0.75, 0], RGBColor[0.67, 0.54, 0.42]}]PlotStyleを使ってすべてのチャート要素の初期スタイルを設定することができる:
data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, 0, 5, 1}];DistributionChart[data, PlotStyle -> EdgeForm[Dashed]]Styleを使ってスタイルを無効にすることができる:
d[μ_] := RandomVariate[NormalDistribution[μ, 1], 100];DistributionChart[{d[1], d[2], Style[d[3], RGBColor[0.93, 0.27, 0.27]], d[4], d[5]}, PlotStyle -> {RGBColor[0.797253, 0.904982, 0.410498], RGBColor[0.934691, 0.945708, 0.75346], RGBColor[0.769879, 0.92369, 0.977371], RGBColor[1, 0.566415, 0.0386511], RGBColor[1, 1, 0.4]}]ChartElementData["DistributionChart"]data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, 0, 5, 1}];Table[DistributionChart[data, PlotStyle -> {RGBColor[0.8352941176470589, 0.5764705882352941, 0.5607843137254902], RGBColor[0.9490196078431372, 0.29411764705882354, 0.050980392156862744], RGBColor[1., 0.7333333333333333, 0.2], RGBColor[0.996078431372549, 0.9490196078431372, 0.44313725490196076], RGBColor[0.7058823529411765, 0.6862745098039216, 0.30196078431372547], RGBColor[0.41568627450980394, 0.5450980392156862, 0.12156862745098039]}, ChartElementFunction -> cf], {cf, {"Density", "HistogramDensity"}}]詳細設定には「パレット」▶「チャートエレメントスキーム」を使う:
DistributionChart[data, PlotStyle -> {RGBColor[0.8352941176470589, 0.5764705882352941, 0.5607843137254902], RGBColor[0.9490196078431372, 0.29411764705882354, 0.050980392156862744], RGBColor[1., 0.7333333333333333, 0.2], RGBColor[0.996078431372549, 0.9490196078431372, 0.44313725490196076], RGBColor[0.7058823529411765, 0.6862745098039216, 0.30196078431372547], RGBColor[0.41568627450980394, 0.5450980392156862, 0.12156862745098039]}, ChartElementFunction -> ChartElementData["GlassQuantile", "Quantile" -> 9, "QuantileShading" -> True]]data = Table[RandomVariate[BetaDistribution[μ, 1 / 4], 100], {μ, 1, 4, 1}];Table[DistributionChart[data, PlotLabel -> o, BarOrigin -> o], {o, {Bottom, Top, Left, Right}}]data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, {0, 1, 2}}];Table[DistributionChart[{data, data}, BarSpacing -> sp, PlotLabel -> sp, PlotStyle -> Opacity[0.8]], {sp, {Automatic, {0, 1}, {-0.3, 1}}}]暗い背景でコントラストがはっきりしたスタイルのテーマを使う:
data = RandomVariate[NormalDistribution[RandomInteger[5], 1], {3, 3, 100}];DistributionChart[data, PlotTheme -> "Marketing"]DistributionChart[data, PlotTheme -> "Business"]ラベルと凡例 (8)
Labeledを使って形にラベルを付ける:
d[μ_] := RandomVariate[NormalDistribution[μ, 1], 100];DistributionChart[{d[1], Labeled[d[2], "label"], d[3]}]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}}]data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, {0, 2}}, {3}];DistributionChart[data, PlotLabels -> <|"Elements" -> {"c1", "c2", "c3"}|>]DistributionChart[data, PlotLabels -> <|"Groups" -> {"r1", "r2"}|>]DistributionChart[data, PlotLabels -> <|"Groups" -> {"r1", "r2"}, "Elements" -> {"c1", "c2", "c3"}|>]Labeledと同じ位置を使い,Placedを使ってラベル配置を制御する:
data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, {0, 2}}, {3}];DistributionChart[data, PlotLabels -> <|"Groups" -> Placed[{"r1", "r2"}, Above], "Elements" -> Placed[{"c1", "c2", "c3"}, Center]|>]LabelingFunctionを使って形に値のラベルを付ける:
data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, {0, 2}}, {3}];DistributionChart[data, LabelingFunction -> (Placed[Mean[#], Tooltip]&)]Placedを使って配置とフォーマットを制御する:
labeler[v_, {i_, j_}, {ri_, cj_}] := Placed[Row[{ri[[1]], cj[[1]]}, ","], Center, Rotate[#, Pi / 4]&]DistributionChart[data, PlotLabels -> <|"Groups" -> {"r1", "r2"}, "Elements" -> {"c1", "c2", "c3"}|>, LabelingFunction -> labeler]data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, {0, 2}}, {3}];DistributionChart[data, PlotLegends -> <|"Elements" -> {"ccc1", "ccc2", "ccc3"}|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>]DistributionChart[data, PlotLegends -> <|"Groups" -> {"rr1", "rr2"}|>, PlotStyle -> <|"Groups" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}|>]Legendedを使って追加的な凡例項を設ける:
d[μ_] := RandomVariate[NormalDistribution[μ, 1], 100];DistributionChart[{d[1], Legended[d[2], "extra"], d[3]}, PlotLegends -> <|"Elements" -> {"ccc1", "ccc2", "ccc3"}|>, PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}]DistributionChart[Legended[{d[1], d[2], d[3]}, "extra"], PlotLegends -> {"ccc1", "ccc2", "ccc3"}, PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}]Placedを使って凡例の位置に影響を与える:
data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, {0, 2}}, {3}];Table[DistributionChart[data, PlotLegends -> <|"Elements" -> Placed[{"ccc1", "ccc2", "ccc3"}, p]|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>, ImageSize -> 225], {p, {Below, Above}}]オプション (32)
AspectRatio (3)
デフォルトで,DistributionChartはプロットに固定の縦横比を使う:
DistributionChart[IconizedObject[«data»]]AspectRatio1を使って縦と横を等しくする:
DistributionChart[IconizedObject[«data»], AspectRatio -> 1]AspectRatioFullは他の構造物にピッタリ収まるように縦と横を調整する:
plot = DistributionChart[IconizedObject[«data»], AspectRatio -> Full];
{Framed[Pane[plot, {100, 150}]], Framed[Pane[plot, {100, 100}]], Framed[Pane[plot, {150, 100}]]}BarOrigin (1)
BarSpacing (4)
DistributionChartは棒と棒の間隔を自動的に選ぶ:
Table[DistributionChart[RandomVariate[NormalDistribution[], {n, 100}]], {n, {1, 2, 4, 8}}]Table[DistributionChart[RandomVariate[NormalDistribution[], {n, 2, 100}]], {n, {2, 4}}]Table[DistributionChart[RandomVariate[NormalDistribution[], {5, 100}], BarSpacing -> s, PlotLabel -> s], {s, {Tiny, Small, Medium, Large}}]Table[DistributionChart[RandomVariate[NormalDistribution[], {3, 2, 100}], BarSpacing -> s, PlotLabel -> s], {s, {Tiny, Small, Medium, Large}}]Table[DistributionChart[RandomVariate[NormalDistribution[], {5, 100}], BarSpacing -> s, PlotLabel -> s], {s, {0.25, 0.5, 1, 2}}]Table[DistributionChart[RandomVariate[NormalDistribution[], {4, 2, 100}], BarSpacing -> s, PlotLabel -> s], {s, {{0.25, 0.5}, {0, 1}}}]DistributionChart[RandomVariate[NormalDistribution[], {5, 100}], BarSpacing -> None]DistributionChart[RandomVariate[NormalDistribution[], {3, 2, 100}], BarSpacing -> {None, 1}]ChartElementFunction (5)
ChartElementFunctionの組込み設定のリストを得る:
ChartElementData["DistributionChart"]詳細設定は「パレット」▶「チャートエレメントスキーム」を使用のこと:
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"}}]DistributionChart[RandomVariate[NormalDistribution[0, 1], {8, 100}], ChartElementFunction -> ChartElementData["SmoothDensity", "ColorScheme" -> "DeepSeaColors"]]Table[DistributionChart[RandomVariate[NormalDistribution[], {5, 100}], ChartElementFunction -> ChartElementData[f, "QuantileShading" -> True, "Quantile" -> 10]], {f, {"Quantile", "DensityQuantile", "FadingQuantile", "GlassQuantile"}}]カスタム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}], PlotStyle -> {RGBColor[0.8352941176470589, 0.5764705882352941, 0.5607843137254902], RGBColor[0.9490196078431372, 0.29411764705882354, 0.050980392156862744], RGBColor[1., 0.7333333333333333, 0.2]}, ChartElementFunction -> quantileBead]ChartLayout (2)
ChartLayoutはデフォルトでグループ化される:
data = RandomVariate[NormalDistribution[0, 1], {2, 3, 100}];DistributionChart[data]DistributionChart[RandomVariate[NormalDistribution[0, 1], {4, 2, 100}], ChartLayout -> "Overlapped", ChartBaseStyle -> Opacity[0.3]]LabelingFunction (2)
デフォルトで,棒にはデータを要約した表のツールチップが付く:
DistributionChart[RandomVariate[NormalDistribution[], {5, 20}]]label[data_, index_, label_] := Grid[{{"Case:", index[[2]]}, {"Year:", label[[2, 1]]}, {"μ:", Mean[data]}}, Alignment -> {{Right, Left}}]DistributionChart[RandomVariate[NormalDistribution[], {5, 20}], LabelingFunction -> (Placed[label[##], Tooltip]&), ChartLabels -> Placed[Range[2005, 2009], None]]LabelingSize (4)
DistributionChart[RandomVariate[NormalDistribution[], {5, 20}], ChartLabels -> {"healthfulness", "obstreperous", "spectrogram", "vestige", "coinage", "limey"}]DistributionChart[RandomVariate[NormalDistribution[], {5, 20}], PlotLabels -> Placed[{[image], [image], [image], [image], [image]}, Axis]]DistributionChart[RandomVariate[NormalDistribution[], {5, 20}], PlotLabels -> {"healthfulness", "obstreperous", "spectrogram", "vestige", "coinage", "limey"}, LabelingSize -> 50]DistributionChart[RandomVariate[NormalDistribution[], {5, 20}], PlotLabels -> {[image], [image], [image], [image], [image]}, LabelingSize -> 30]DistributionChart[RandomVariate[NormalDistribution[], {5, 20}], PlotLabels -> {"healthfulness", "obstreperous", "spectrogram", "vestige", "coinage", "limey"}, LabelingSize -> Full, ImageSize -> Medium]Method (1)
data = Table[RandomReal[NormalDistribution[], i], {i, {100, 400, 900, 1600}}];DistributionChart[data, Method -> {"BoxWidth" -> "Scaled"}, PlotLabels -> Length /@ data]DistributionChart[data, Method -> {"BoxWidth" -> "Scaled", "EqualSpacing" -> False}, PlotLabels -> Length /@ data]DistributionChart[data, Method -> {"BoxWidth" -> "Fixed"}]PerformanceGoal (3)
DistributionChart[RandomVariate[NormalDistribution[], {5, 20}], PerformanceGoal -> "Quality"]インタラクティブな動作を無効にすることでパフォーマンスを向上させる:
DistributionChart[RandomVariate[NormalDistribution[], {5, 20}], PerformanceGoal -> "Speed"]一般に,インタラクティブ機能がない方がメモリ使用量は少なくて済む:
Table[ByteCount@DistributionChart[RandomVariate[NormalDistribution[], {5, 100}], PerformanceGoal -> p], {p, {"Quality", "Speed"}}]PlotInteractivity (4)
棒の数がそれほど多くないグラフには,ツールチップとマウスオーバー効果が自動的に付けられる:
DistributionChart[{IconizedObject[«Subscript[data, 1]»], IconizedObject[«Subscript[data, 2]»], IconizedObject[«Subscript[data, 3]»], IconizedObject[«Subscript[data, 4]»]}]DistributionChart[{IconizedObject[«Subscript[data, 1]»], IconizedObject[«Subscript[data, 2]»], IconizedObject[«Subscript[data, 3]»], IconizedObject[«Subscript[data, 4]»]}, PlotInteractivity -> False]入力の一部として与えらえたインタラクティブ要素を無効にする:
DistributionChart[{IconizedObject[«Subscript[data, 1]»], IconizedObject[«Subscript[data, 2]»], IconizedObject[«Subscript[data, 3]»], Tooltip[IconizedObject[«Subscript[data, 4]»], "hello"]}, PlotInteractivity -> False]与えたインタラクティブ要素は有効にして,自動のものは無効にする:
DistributionChart[{IconizedObject[«Subscript[data, 1]»], IconizedObject[«Subscript[data, 2]»], IconizedObject[«Subscript[data, 3]»], Tooltip[IconizedObject[«Subscript[data, 4]»], "hello"]}, PlotInteractivity -> <|"User" -> True, "System" -> False|>]PlotTheme (1)
data = RandomVariate[NormalDistribution[RandomInteger[5], 1], {3, 3, 100}];DistributionChart[data, PlotTheme -> "Business"]DistributionChart[data, PlotTheme -> {"Business", "FrameGrid"}]DistributionChart[data, PlotTheme -> {"Business", "FrameGrid"}, GridLinesStyle -> LightRed]ScalingFunctions (2)
DistributionChart[RandomReal[NormalDistribution[50, 10], {3, 100}]]DistributionChart[RandomReal[NormalDistribution[50, 10], {3, 100}], ScalingFunctions -> "Log"]data = Range[50] - 25DistributionChart[{data}, ScalingFunctions -> "Log"]アプリケーション (2)
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, PlotLabels -> Placed[{depts, Length /@ data}, {Axis, Center}], ChartStyle -> 54, GridLines -> {{{Median[all], Gray}}, None}, BarOrigin -> Left]data = Table[RandomVariate[WienerProcess[2, 3][t], 10 ^ 3], {t, {1, 4, 7, 10, 13}}];DistributionChart[data, PlotLabels -> {1, 4, 7, 10, 13}]特性と関係 (6)
BoxWhiskerChartを使ってデータの分布を示す:
data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, 0, 4, 1}];BoxWhiskerChart[data]BoxWhiskerChartはDistributionChartの特殊ケースである:
data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ, 0, 4, 1}];DistributionChart[data, "BoxWhisker"]HistogramとSmoothHistogramを使ってデータベクトルのリストを可視化する:
data = Table[RandomVariate[NormalDistribution[μ, 1], 200], {μ, 0, 8, 4}];{Histogram[data, Automatic, "PDF"], SmoothHistogram[data]}DistributionChartが使うデフォルトの形は事実上SmoothHistogramを使って生成される:
data = RandomVariate[NormalDistribution[], 25];{DistributionChart[data, BarOrigin -> Left], SmoothHistogram[data]}QuantilePlotとProbabilityPlotを使ってデータと分布を比較する:
data = RandomVariate[NormalDistribution[0, 1], 200];{QuantilePlot[data], ProbabilityPlot[data]}Histogram3DとSmoothHistogram3Dを使って,二次元データを可視化する:
data = RandomVariate[NormalDistribution[2, 1], {200, 2}];{Histogram3D[data], SmoothHistogram3D[data]}履歴
2010 で導入 (8.0) | 2012 で更新 (9.0) ▪ 2014 (10.0) ▪ 2018 (11.3) ▪ 2025 (14.2) ▪ 2025 (14.3)
テキスト
Wolfram Research (2010), DistributionChart, Wolfram言語関数, https://reference.wolfram.com/language/ref/DistributionChart.html (2025年に更新).
CMS
Wolfram Language. 2010. "DistributionChart." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/DistributionChart.html.
APA
Wolfram Language. (2010). DistributionChart. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DistributionChart.html
BibTeX
@misc{reference.wolfram_2026_distributionchart, author="Wolfram Research", title="{DistributionChart}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/DistributionChart.html}", note=[Accessed: 16-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_distributionchart, organization={Wolfram Research}, title={DistributionChart}, year={2025}, url={https://reference.wolfram.com/language/ref/DistributionChart.html}, note=[Accessed: 16-September-2026]}