BubbleHistogram[{{x1,y1},{x2,y2},…}]
绘制值 {xi,yi} 的气泡直方图.
BubbleHistogram[{{x1,y1},{x2,y2},…},bspec]
绘制一个气泡直方图,其分箱由 bspec 指定.
BubbleHistogram[{{x1,y1},{x2,y2},…},bspec,hspec]
绘制一个气泡直方图,其中气泡大小根据规范 hspec 计算.
BubbleHistogram
BubbleHistogram[{{x1,y1},{x2,y2},…}]
绘制值 {xi,yi} 的气泡直方图.
BubbleHistogram[{{x1,y1},{x2,y2},…},bspec]
绘制一个气泡直方图,其分箱由 bspec 指定.
BubbleHistogram[{{x1,y1},{x2,y2},…},bspec,hspec]
绘制一个气泡直方图,其中气泡大小根据规范 hspec 计算.
更多信息
- BubbleHistogram 通过使用大小和颜色与每个箱中元素数量成比例的气泡来显示离散箱中的数据密度.
- BubbleHistogram[data] 默认绘制一个直方图,其中选用大小相等的分箱来近似值 {xi,yi} 的假定底层平滑分布.
- 每个分箱的
宽度根据数值 xi 计算,而
宽度则根据数值 yi 计算. - BubbleHistogram[Tabular[…]cspec] 使用列规范 cspec 从表格对象中提取并绘制值.
- 绘制表格数据时,允许使用以下形式的列规范 cspec:
-
{colx,coly} 来自列 colx 和列 coly 的直方图值 {x,y} - 可以给出以下分箱规范 bspec:
-
n 使用 n 个箱 {w} 使用宽度为 w 的箱 {min,max,w} 使用宽度 w 从 min 到 max 的箱 {{b1,b2,…}} 使用箱 [b1,b2),[b2,b3),… Automatic 自动确定箱宽 "name" 使用命名的分箱方法 {"Log",bspec} 对经对数变换后的数据应用分箱 bspec fb 应用 fb 以获得显式的箱规范 {b1,b2,…} {xspec,yspec} 给出不同的 x 和 y 规范 - 分箱规范 "Log" 采用 Automatic 底层分箱方法.
- 可能的命名分箱方法包括:
-
"Sturges" 根据数据长度计算箱数 "Scott" 渐近地最小化均方误差 "FreedmanDiaconis" 四分位距的两倍除以样本量的立方根 "Knuth" 平衡分段均匀模型的似然与先验概率 "Wand" 单层递归近似 Wand 分箱 - BubbleHistogram[data,fb] 中的函数 fb 应用于所有 {xi,yi} 的列表,并且应返回一个显式的分箱列表 {{bx1,bx2,…},{by1,by2,…}}. 在 BubbleHistogram[data,{fx,fy}] 中,fx 应用于 xi 的列表,而 fy 应用于 yi 的列表.
- 通过在 BubbleHistogram[data,bspec,hspec] 中给出不同的分箱气泡规范 hspec,可以得到不同形式的气泡直方图. 可以使用以下形式:
-
"Count" 每个箱中的元素数量 "CumulativeCount" 累积计数 "SurvivalCount" 生存计数 "Probability" 落在每个箱中的值所占比例 "Intensity" 计数除以箱面积 "PDF" 概率密度函数 "CDF" 累积分布函数 "SF" 生存函数 "HF" 风险函数 "CHF" 累积风险函数 {"Log",hspec} 经对数变换后的高度规范 fh 通过将 fh 应用于箱和计数而得到的高度 - BubbleHistogram[data,bspec,fh] 中的函数 fh 会被应用于三个参数:一个
分箱列表 {{bx1,bx2},{bx2,…},…}、一个
分箱列表 {{by1,by2},{by2,…},…},以及对应的二维计数数组 {{c11,c12,…},{c21,…},…}. 该函数应返回一个计数数组,供每个 cij 使用. - 只有由实数组成的值 {xi,yi} 才会被分配到箱中;其他值将被视为缺失.
- BubbleHistogram 具有与 Graphics 相同的选项,并有以下增加和更改: [所有选项的列表]
-
AspectRatio 1 高度与宽度的比率 ChartElementFunction Automatic 如何为区块生成原始图形 ClippingStyle None 如何绘制被 PlotRange 裁剪的值 ColorFunction Automatic 如何为图着色 ColorFunctionScaling True 是否缩放传递给 ColorFunction 的参数 Frame True 是否在图周围绘制边框 FrameTicks Automatic 边框刻度标记 LabelingFunction Automatic 如何为元素加标签 Method Automatic 用于细化绘图的方法 PerformanceGoal $PerformanceGoal 尝试优化的性能方面 PlotInteractivity $PlotInteractivity 是否允许交互元素 PlotLegends None 数据元素和数据集的图例 PlotRange Automatic 要包含的 f 或其他值的范围 PlotRangeClipping True 是否在绘图范围处裁剪 PlotRangePadding Automatic 数值范围需要填充多少 PlotStyle Automatic 用于气泡的样式 PlotTheme $PlotTheme 绘图的整体主题 ScalingFunctions None 如何缩放各个坐标 - 提供给 ChartElementFunction 的参数包括分箱区域 {{xmin,xmax},{ymin,ymax}}、分箱值 lists,以及元数据 {m1,m2,…}.
- 提供给 ColorFunction 的参数是每个箱的密度.
- 通过设置 ScalingFunctions->{sx,sy,sz},
坐标使用 sx 等进行缩放 - 样式及其他选项实际上是按 PlotStyle、ColorFunction 以及 ChartElementFunction 的顺序应用的,其中后面的规范会覆盖前面的规范.
所有选项的列表
范例
打开所有单元 关闭所有单元基本范例 (3)
BubbleHistogram[RandomVariate[BinormalDistribution[.5], 500]]BubbleHistogram[RandomVariate[BinormalDistribution[.5], 500], PlotLegends -> Automatic]data = RandomVariate[BinormalDistribution[.5], 100];BubbleHistogram[data, Automatic, "PDF"]BubbleHistogram[data, Automatic, "CDF"]BubbleHistogram[data, Automatic, "SF"]BubbleHistogram[data, Automatic, "HF"]BubbleHistogram[data, Automatic, "CHF"]范围 (14)
数据 (8)
data = RandomReal[NormalDistribution[0, 1], {200, 2}];BubbleHistogram[data, 5]BubbleHistogram[data, {3, 5}, Mesh -> True]data = RandomReal[NormalDistribution[0, 1], {200, 2}];BubbleHistogram[data, {.5}]BubbleHistogram[data, {{.5}, {2}}]data = RandomReal[NormalDistribution[0, 1], {200, 2}];BubbleHistogram[data, {-2, 2, 0.5}]BubbleHistogram[data, {{-2, 2, 0.5}, {-3, 3, 1.5}}]data = RandomReal[NormalDistribution[0, 1], {500, 2}];BubbleHistogram[data, {{-3, -1, 0, 1, 3}}, Mesh -> All]BubbleHistogram[data, {{{-3, -1, 0, 1, 3}}, {{-1, 0, 2, 3}}}, Mesh -> All]data = RandomReal[NormalDistribution[0, 1], {500, 2}];Table[BubbleHistogram[data, b, PlotLabel -> b], {b, {"Sturges", "Scott", "FreedmanDiaconis", "Wand", "Knuth"}}]Table[BubbleHistogram[data, {"Log", b}, PlotLabel -> "Log" <> b], {b, {"Sturges", "Scott", "FreedmanDiaconis", "Wand", "Knuth"}}]data = RandomReal[NormalDistribution[0, 1], {200, 2}];Table[BubbleHistogram[data, Automatic, h, PlotLabel -> h], {h, {"Count", "PDF", "CDF", "SF", "HF", "CHF"}}]Table[BubbleHistogram[data, Automatic, {"Log", h}, PlotLabel -> "Log" <> h], {h, {"Count", "PDF", "CDF", "SF", "HF", "CHF"}}]accumulatedCount[xBins_, yBins_, counts_] := Block[{newCounts, heights}, newCounts = Flatten[Transpose[counts]];heights = 100 Accumulate[newCounts] / Total[newCounts];Transpose[Partition[heights, {Length[xBins]}]]];BubbleHistogram[RandomReal[NormalDistribution[0, 1], {100, 2}], Automatic, accumulatedCount, ColorFunction -> "FallColors"]BubbleHistogram[{{1, 1}, {2, 2}, {3, 3}, None, {3, 3}, {5, 5}, Missing[], {2, 2}, {1, 1}, foo, {2, 2}, {3, 3}}]表格数据 (1)
tab = Tabular[ResourceData["Sample Data: Wine Quality"]]BubbleHistogram[tab -> {"PH", "Alcohol"},
FrameLabel -> {"pH", "alcohol content"},
PlotLegends -> Automatic]BubbleHistogram[tab -> {"PH", "Alcohol"}, 15, BubbleSizes -> {0.25, 1},
FrameLabel -> {"pH", "alcohol content"},
PlotLegends -> Automatic]演示 (5)
data = RandomReal[NormalDistribution[0, 1], {200, 2}];BubbleHistogram[data, PlotLabel -> "plot label", FrameLabel -> {"xlabel", "ylabel"}]默认情况下,BubbleHistogram 同时使用颜色和大小来表示计数:
data = RandomReal[NormalDistribution[0, 1], {200, 2}];BubbleHistogram[data]BubbleHistogram[data, BubbleSizes -> {1, 1}, ColorFunction -> "BlueGreenYellow"]BubbleHistogram[data, ColorFunction -> None, BubbleSizes -> {0.1, 1}]data = RandomReal[NormalDistribution[0, 1], {200, 2}];BubbleHistogram[data, Mesh -> All]data = RandomReal[NormalDistribution[0, 1], {1000, 2}];BubbleHistogram[data, PlotLegends -> Automatic]BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], PlotTheme -> "Detailed"]BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], PlotTheme -> "Minimal"]选项 (62)
AspectRatio (3)
默认情况下,BubbleHistogram 使用相同的宽度和高度:
BubbleHistogram[IconizedObject[«data»]]BubbleHistogram[IconizedObject[«data»], AspectRatio -> 1 / 2]使用 Automatic 根据数值确定比率:
BubbleHistogram[IconizedObject[«data»], AspectRatio -> Automatic]坐标轴 (4)
默认情况下,BubbleHistogram 使用边框而不是坐标轴:
BubbleHistogram[IconizedObject[«data»]]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True]使用 AxesOrigin 指定坐标轴的相交位置:
BubbleHistogram[IconizedObject[«data»], Axes -> True, Frame -> False, AxesOrigin -> {0, 0}]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> {True, False}]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> {False, True}]AxesLabel (4)
BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, AxesLabel -> y]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, AxesLabel -> {x, y}]BubbleHistogram[QuantityArray[IconizedObject[«data»], "Meters"], Frame -> False, Axes -> True, AxesLabel -> Automatic]AxesOrigin (2)
AxesStyle (4)
BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, AxesStyle -> RGBColor[0.93, 0.27, 0.27]]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, AxesStyle -> {{Thick, RGBColor[0.93, 0.27, 0.27]}, {Thick, RGBColor[0.4, 0.6, 1]}}]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, AxesStyle -> RGBColor[0.14, 0.8, 0.14], TicksStyle -> RGBColor[0.93, 0.27, 0.27]]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, AxesStyle -> RGBColor[0.14, 0.8, 0.14], LabelStyle -> RGBColor[0.93, 0.27, 0.27]]BubbleScale (2)
BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], BubbleSizes -> {0.1, 1}, BubbleScale -> "Diameter"]data = RandomVariate[BinormalDistribution[.5], 100];Table[BubbleHistogram[data, BubbleSizes -> {0.1, 1}, BubbleScale -> scale, PlotLabel -> scale], {scale, {"Area", "Diameter"}}]BubbleSizes (2)
默认情况下,最小的气泡会被缩放到其自身分箱大小的 20%,最大的气泡会被缩放到其自身分箱大小的 100%:
data = RandomVariate[BinormalDistribution[.5], 100];BubbleHistogram[data, Mesh -> All]BubbleHistogram[data, BubbleSizes -> {0.1, 0.8}, Mesh -> All]data = RandomVariate[BinormalDistribution[.5], 100];BubbleHistogram[data, BubbleSizes -> {1, 0.2}, Mesh -> All]ChartElementFunction (3)
获取 ChartElementFunction 的内置设置列表:
ChartElementData["BubbleHistogram"]Table[BubbleHistogram[RandomVariate[NormalDistribution[], {100, 2}], ChartElementFunction -> cf, PlotLabel -> cf], {cf, {"Bubble", "FadingBubble"}}]Table[BubbleHistogram[RandomVariate[NormalDistribution[], {100, 2}], {1}, ChartElementFunction -> cf, PlotLabel -> cf], {cf, {"GradientBubble", "MarkerBubble", "NoiseBubble", "OscillatingBubble"}}]Table[BubbleHistogram[RandomVariate[NormalDistribution[], {100, 2}], {1}, ChartElementFunction -> cf, PlotLabel -> cf], {cf, {"SphereBubble", "SquareWaveBubble", "TriangleWaveBubble"}}]编写自定义 ChartElementFunction:
f[{{xmin_, xmax_}, {ymin_, ymax_}}, _, _] := Rectangle[{xmin, ymin}, {xmax, ymax}, RoundingRadius -> 0.2]BubbleHistogram[RandomVariate[NormalDistribution[], {100, 2}], {1}, ChartElementFunction -> f]ColorFunction (5)
BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], ColorFunction -> Function[{count}, ColorData["Rainbow"][count]]]BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {500, 2}], ColorFunction -> "SolarColors"]BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {500, 2}], ColorFunction -> (Hue[2 / 5, 2 / 3, #]&)]使用 ColorFunctionScaling->False 获取未缩放的高度值:
BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {500, 2}], ColorFunction -> (Which[# < 5, RGBColor[1, 0.51, 0.51], 5 ≤ # < 15, RGBColor[0.4, 0.6, 1], True, RGBColor[0.93, 0.27, 0.27]]&), ColorFunctionScaling -> False]使用 ColorFunction 组合不同的样式效果:
BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {500, 2}], ColorFunction -> Function[{count}, Directive[ColorData["FuchsiaTones"][1 - count], EdgeForm[Opacity[count]]]]]ColorFunctionScaling (2)
BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], ColorFunction -> Function[{height}, ColorData["Rainbow"][height]]]使用 ColorFunctionScaling->False 获取未缩放的高度值:
BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {500, 2}], ColorFunction -> (Which[# < 5, RGBColor[1, 0.51, 0.51], 5 ≤ # < 15, RGBColor[0.4, 0.6, 1], True, RGBColor[0.93, 0.27, 0.27]]&), ColorFunctionScaling -> False]ImageSize (6)
使用命名尺寸,如 Tiny、Small、Medium 和 Large:
{BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", ImageSize -> Tiny], BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", ImageSize -> Small]}{BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", ImageSize -> 150], BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", AspectRatio -> 1.5, ImageSize -> 150]}{BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", ImageSize -> {Automatic, 150}], BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", AspectRatio -> 2, ImageSize -> {Automatic, 150}]}{BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", ImageSize -> UpTo[200]], BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", AspectRatio -> 2, ImageSize -> UpTo[200]]}BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", ImageSize -> {200, 300}, Background -> RGBColor[0.4, 0.6, 1]]{BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", ImageSize -> {UpTo[150], UpTo[100]}], BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", AspectRatio -> 2, ImageSize -> {UpTo[150], UpTo[100]}]}Framed[Pane[BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Automatic, "PDF", AspectRatio -> 1 / 3, ImageSize -> {Scaled[0.5], Scaled[0.5]}, Background -> RGBColor[0.4, 0.6, 1]], {200, 100}]]LabelingFunction (3)
通过 Tooltip 和 StatusArea 使用值自动标签:
BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], 5, LabelingFunction -> Automatic]BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], 5, LabelingFunction -> None]使用 Placed 控制标签位置:
BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], 5, LabelingFunction -> (Placed[#1, StatusArea]&)]Mesh (5)
BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Mesh -> Automatic]BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Mesh -> {15, 5}]BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], Mesh -> {None, Range[0, 10]}]BubbleHistogram[RandomVariate[BinormalDistribution[.5], 100], {1 / 2}, Mesh -> {None, Table[{i / 2 - 3, Hue[i / 12]}, {i, 0, 12}]}]BubbleHistogram[RandomReal[NormalDistribution[0, 1], {200, 2}], {{{-3, -1, 0, 1, 3}}, {{-1, 0, 2, 3}}}, Mesh -> Automatic]MeshStyle (2)
Method (4)
BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], Method -> {"DistributionAxes" -> True}]BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], Method -> {"DistributionAxes" -> "BoxWhisker"}]BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], Method -> {"DistributionAxes" -> "Histogram"}]BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], Method -> {"DistributionAxes" -> "BoxWhisker"}, ColorFunction -> "RustTones"]BubbleHistogram[RandomVariate[NormalDistribution[0, 1], {200, 2}], Method -> {"DistributionAxes" -> "Histogram"}, ColorFunction -> "DeepSeaColors"]PerformanceGoal (1)
data = RandomReal[NormalDistribution[0, 1], {100, 2}];BubbleHistogram[data, PerformanceGoal -> "Quality"]BubbleHistogram[data, PerformanceGoal -> "Speed"]Table[ByteCount@BubbleHistogram[data, PerformanceGoal -> p], {p, {"Quality", "Speed"}}]PlotInteractivity (2)
Ticks (4)
BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, Ticks -> None]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, Ticks -> {{-2, 0, 3}, {-2, 0, 2}}]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, Ticks -> {{{-2, -a}, {0, 0}, {3, b}}, {{-2, -a}, {0, b}, {2, a}}}]TicksStyle (4)
BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, TicksStyle -> Directive[RGBColor[0.93, 0.27, 0.27], Bold]]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, TicksStyle -> {Directive[RGBColor[0.93, 0.27, 0.27], Bold], Directive[RGBColor[0.4, 0.6, 1]]}]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, Ticks -> {{{-2, -a, .1}, {0, 0, .2}, {3, b, .45}}, {{-2, -a, .1}, {0, b, .2}, {2, a, .5}}}]BubbleHistogram[IconizedObject[«data»], Frame -> False, Axes -> True, Ticks -> {{{-2, -a, .1, Directive[RGBColor[0.93, 0.27, 0.27]]}, {0, 0, .2, Directive[Thick, RGBColor[0.93, 0.27, 0.27]]}, {3, b, .45, Directive[Thick, Dashed, RGBColor[0.93, 0.27, 0.27]]}}, {{-2, -a, .1, Directive[RGBColor[0.4, 0.6, 1]]}, {0, b, .2, Directive[Thick, RGBColor[0.4, 0.6, 1]]}, {2, a, .5, Directive[Thick, Dashed, RGBColor[0.4, 0.6, 1]]}}}]应用 (4)
volcanoes = ExampleData[{"Statistics", "UgandaVolcanoes"}];
border = Graphics[{EdgeForm[Thick], Opacity[0], Polygon[ExampleData[{"Statistics", "WesternUgandaBorder"}]]}];Show[ListPlot[volcanoes], border, AspectRatio -> 1]cfs[data_, bspec_, hspec_ : Automatic] := With[{cnts = Union[Flatten@Last[HistogramList[data, bspec, hspec]]]}, N@Transpose[{Rescale[cnts], cnts}]
]Show[BubbleHistogram[volcanoes, 10, ColorFunction -> "SolarColors", PlotLegends -> Automatic], border]data = RandomVariate[WienerProcess[3, 4][{7, 10}], 10 ^ 4];BubbleHistogram[data, 20, "PDF"]通过绘制二维时间切片的气泡直方图,对 TemporalData 进行分析:
data = TemporalData[«4»];Table[BubbleHistogram[data["SliceData", {.1, y}], Automatic, "PDF"], {y, .2, 1, .1}]data = WeatherData["Champaign", "Temperature", {DateObject[{2022, 1, 1}], DateObject[{2024, 1, 1}]}];datetime = Transpose[{AbsoluteTime /@ data["Times"], Normal[data["Values"]]}];在 x 和 y 方向上,分别以一个月和 5 摄氏度作为分箱宽度:
bins = {{Table[AbsoluteTime@DateObject[{2022, i, 1}], {i, 24}]}, {Quantity[5, "DegreesCelsius"]}};结合日期刻度和分箱信息,使用 BubbleHistogram 对数据进行可视化:
BubbleHistogram[datetime, bins, ScalingFunctions -> {"Date", None}, AspectRatio -> 1 / 2, PlotLabel -> "Temperature variations across the year in Champaign"
]frameticks = {{Transpose[{Range[-20, 40, 5], Quantity[Range[-20, 40, 5], "DegreesCelsius"]}], None},
{Table[{AbsoluteTime@DateObject[{2022, 2i - 1}], Rotate[DateObject[{2022, 2i - 1}], 90Degree]}, {i, 12}], None}};
mesh = {Transpose[{Range[-25, 40, 5], Reverse@Table[Blend[{RGBColor[0.93, 0.27, 0.27], RGBColor[0.4, 0.6, 1]}, i / 10], {i, 14}]}], Automatic} ;
meshstyle = {Directive[{Opacity[0.9]}], Directive[{GrayLevel[0.7], Opacity[0.4]}]};BubbleHistogram[datetime, bins,
AspectRatio -> 1 / 2,
FrameTicks -> frameticks,
Mesh -> mesh,
MeshStyle -> meshstyle,
PlotStyle -> EdgeForm[GrayLevel[0.62]],
PlotLabel -> "Temperature variations across the year in Champaign"
]属性和关系 (4)
BubbleHistogram 根据数据自动确定要使用的分箱:
BubbleHistogram[RandomVariate[NormalDistribution[], {100, 2}]]BubbleHistogram 根据 ColorFunction 对高度进行着色:
BubbleHistogram[RandomVariate[NormalDistribution[], {100, 2}], Automatic, "CDF", ColorFunctionScaling -> False, PlotLegends -> Automatic]使用 Histogram3D 在三维中可视化数据:
data = RandomVariate[NormalDistribution[], {100, 2}];{Histogram3D[data], BubbleHistogram[data], DensityHistogram[data]}使用 DensityHistogram、SmoothDensityHistogram 和 SmoothHistogram3D 将估计分布与数据进行比较:
data = RandomVariate[BinormalDistribution[{2, 2}, {1, 1}, 0.5], 100];{BubbleHistogram[data], DensityHistogram[data], SmoothDensityHistogram[data], SmoothHistogram3D[data]}可能存在的问题 (1)
巧妙范例 (1)
PlotGrid[Partition[Table[BubbleHistogram[RandomVariate[BinormalDistribution[ρ], 10 ^ 3], {-3, 3, .25}, ColorFunction -> "SolarColors", PlotLabel -> ρ, ImageSize -> 150, PlotRange -> {{-3, 3}, {-3, 3}}], {ρ, {-.95, -.75, -.5, -.25, 0, .25, .5, .75, .95 }}], 3], ItemSize -> 150]文本
Wolfram Research (2026),BubbleHistogram,Wolfram 语言函数,https://reference.wolfram.com/language/ref/BubbleHistogram.html.
CMS
Wolfram 语言. 2026. "BubbleHistogram." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/BubbleHistogram.html.
APA
Wolfram 语言. (2026). BubbleHistogram. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/BubbleHistogram.html 年
BibTeX
@misc{reference.wolfram_2026_bubblehistogram, author="Wolfram Research", title="{BubbleHistogram}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/BubbleHistogram.html}", note=[Accessed: 13-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_bubblehistogram, organization={Wolfram Research}, title={BubbleHistogram}, year={2026}, url={https://reference.wolfram.com/language/ref/BubbleHistogram.html}, note=[Accessed: 13-August-2026]}