BubbleChart3D[{{x1,y1,z1,u1},{x2,y2,z2,u2},…}]
制作一个三维气泡图,坐标 {xi,yi,zi} 处的气泡大小为 ui.
BubbleChart3D[{…,wi[{xi,yi,zi,ui},…],…,wj[{xj,yj,zj,uj},…],…}]
制作一个三维气泡图表,其气泡特点由 wk 定义.
BubbleChart3D[{data1,data2,…}]
根据多个数据集 datai 制作一个三维气泡图.
BubbleChart3D
BubbleChart3D[{{x1,y1,z1,u1},{x2,y2,z2,u2},…}]
制作一个三维气泡图,坐标 {xi,yi,zi} 处的气泡大小为 ui.
BubbleChart3D[{…,wi[{xi,yi,zi,ui},…],…,wj[{xj,yj,zj,uj},…],…}]
制作一个三维气泡图表,其气泡特点由 wk 定义.
BubbleChart3D[{data1,data2,…}]
根据多个数据集 datai 制作一个三维气泡图.
更多信息和选项
- BubbleChart3D 的数据元素可以按下列形式给出:
-
{xi,yi,zi,ui} 纯气泡值 {Quantity[xi,ux],Quantity[yi,uy],Quantity[zi,uz],Quantity[ui,uu]} 带有单位的气泡值 <|kxxi,kyyi,kzzi,kuui|> 键和气泡值的关联 wi[{xi,yi,zi,ui},…] 值 {xi,yi,zi,ui}、封装 wi 的气泡 formi->mi 有元数据 mi 的扇形 - 值 ui 应为正值.
- 没有按这些形式给出的数据在形成三维气泡图过程中被忽略.
- BubbleChart3D 的数据集可以按下列形式给出:
-
{e1,e2,…} 有封装和无封装的元素列表 <|k1e1,k2e2,…|> 键和值的关联 TimeSeries[…],EventSeries[…],TemporalData[…] 时间序列、事件序列和时间数据 WeightedData[…] 扩展数据集 w[{e1,e2,…},…] 应用到整个数据集中的封装 w[{data1,data1,…},…] 应用到所有数据集中的封装 - BubbleChart3D[objcspec] 用列指定 cspec 从 Tabular、TimeSeries 或 EventSeries 对象 obj 中提取值并绘制.
- 可使用以下形式的列指定 cspec 来绘制表格数据:
-
{colx,coly,colz,colw} 绘制列 x、y、z 和 w 的数据 {{colx1,coly1,colz1,colw1},{colx2,coly2,colz2,colw2},…} 绘制列的多个集 - 下列封装可以在图表元素中使用:
-
Annotation[e,label] 提供一个注解 Button[e,action] 当点击元素时执行的行为 EventHandler[e,…] 对元素定义一个普通的事件处理器 Hyperlink[e,uri] 元素作为超链接 Labeled[e,…] 用标签显示元素 Legended[e,…] 在图例中包含元素的特点 Mouseover[e,over] 元素显示鼠标指向的形式 PopupWindow[e,cont] 对元素附上一个弹出窗口 StatusArea[e,label] 当鼠标指向元素时,显示在状态栏上 Style[e,opts] 用指定样式显示元素 Tooltip[e,label] 对元素增加任意工具提示 - 在 BubbleChart3D 中, Labeled 和 Placed 允许使用下列坐标:
-
Top,Bottom,Left,Right,Center, Front,Back 在气泡图中的坐标 Above,Below, Before, After 在气泡图外的坐标 {{bx,by,bz},{lx,ly}} 缩放尺度坐标 {lx,ly} 到气泡图坐标 {bx,by,bz} - BubbleChart3D 有和 Graphics3D 相同的选项,并有下列附加变化: [所有选项的列表]
-
Axes True 是否绘制轴 AxesEdge {{-1, -1}, {1, -1}, {-1, -1}} 哪条边上放置轴 Boxed {Left,Bottom,Back} 哪个面上放置边界框 BoxRatios {1,1,1} 三维边界框的比例 BubbleScale "Volume" 气泡图使用的大小特点 BubbleSizes Automatic 气泡图使用的尺寸范围 ChartElementFunction Automatic 如何产生气泡的原图形 ChartElements Automatic 用于每个气泡的图形 ColorFunction Automatic 如何着色气泡 ColorFunctionScaling True 是否正规化 ColorFunction 的参数 FaceGrids Automatic 在边界框上绘制的网格线 LabelingFunction Automatic 如何标注气泡 LegendAppearance Automatic 图例的整体外观 Lighting "Neutral" 使用的模拟光源 PerformanceGoal $PerformanceGoal 优化的目标 PlotInteractivity $PlotInteractivity 是否允许绘制互动元素 PlotLabels None 泡的类别标签 PlotLegends None 数据元素和数据集的图例 PlotStyle Automatic 气泡的样式 PlotTheme $PlotTheme 绘图的整体主题 ScalingFunctions None 如何调整单个坐标 TargetUnits Automatic 在图中显示的单位 - 设置 ChartElements->g,图形 g 将形成包含延伸 g 的图片气泡.
- PlotLegends 的常见设置包括:
-
None 没有图例 Automatic 自动确定图例 {lbl1,lbl2,…} 用 lbl1, lbl2, … 作为图例的标签 Placed[lspec,…] 指定图例的位置 - PlotStylesty 指定每组数据使用的样式. 可能的设置包括:
-
{sty1,sty2,…} 针对每组数据的一系列样式 <|"key"val,…|> 针对不同层级的数据的样式元素 - 接受的键有:
-
"Base" 所有气泡的整体样式 "Elements" 针对每个组中的元素 yi 的样式列表 "Groups" 每个数据组 datai 的样式列表 - ColorData["DefaultChartColors"] 给出 PlotStyle 使用的默认颜色序列.
- ChartElementFunction 参数是气泡区域 {{xmin,xmax},{ymin,ymax},{zmin,zmax}},从数据集的嵌套列表中每层获得的值 {xi,yi,zi,ui} 和元数据 {m1,m2,…}.
- ChartElementFunction 的内置设置列表可以从 ChartElementData["BubbleChart3D"]获得.
- ColorFunction 的参数是 x,y,z 和 u.
- BubbleChart3D 中对样式及用于选项及其它结构的说明实际上按 ChartStyle、ColorFunction、Style 和其它封装,ChartElements 和 ChartElementFunction 的先后顺序应用,后面的规范说明会覆盖之前的规范说明.
所有选项的列表
范例
打开所有单元 关闭所有单元基本范例 (3)
BubbleChart3D[RandomReal[1, {10, 4}]]BubbleChart3D[RandomReal[1, {5, 10, 4}]]BubbleChart3D[RandomReal[1, {5, 10, 4}], PlotStyle -> {RGBColor[0.237736, 0.340215, 0.575113], RGBColor[0.277947, 0.45009699999999997, 0.32815550000000004], RGBColor[0.624866, 0.673302, 0.264296], RGBColor[0.8453409999999999, 0.6248695, 0.3151775], RGBColor[0.72987, 0.239399, 0.230961]}]BubbleChart3D[RandomReal[1, {10, 4}], ChartElements -> [image]]BubbleChart3D[RandomReal[1, {10, 4}], ChartElementFunction -> "MarkerBubble3D"]范围 (31)
数据和封装 (14)
BubbleChart3D[{Table[{i, i, i, 1}, {i, 3}], Table[{i, i, i + 1, 1}, {i, 3}], Table[{i, i, i + 2, 1}, {i, 3}]}]data = ReplacePart[Flatten[Table[{i, 2, j, 1}, {i, 4}, {j, 4}], 1], {3 -> Missing[], 6 -> 1 + I, 15 -> foo}]BubbleChart3D[data, PlotLabels -> Range[16]]BubbleChart3D[{{Quantity[8, "Feet"], Quantity[17, "Feet"], Quantity[3, "Feet"], Quantity[10, "Feet"]}, {Quantity[15, "Feet"], Quantity[19, "Feet"], Quantity[1, "Feet"], Quantity[23, "Feet"]}, {Quantity[2, "Feet"], Quantity[20, "Feet"], Quantity[15, "Feet"], Quantity[15, "Feet"]}, {Quantity[21, "Feet"], Quantity[6, "Feet"], Quantity[3, "Feet"], Quantity[25, "Feet"]}, {Quantity[12, "Feet"], Quantity[24, "Feet"], Quantity[4, "Feet"], Quantity[3, "Feet"]}, {Quantity[1, "Feet"], Quantity[15, "Feet"], Quantity[17, "Feet"], Quantity[5, "Feet"]}}, AxesLabel -> Automatic]BubbleChart3D[{{Quantity[8, "Feet"], Quantity[17, "Feet"], Quantity[3, "Feet"], Quantity[10, "Feet"]}, {Quantity[15, "Feet"], Quantity[19, "Feet"], Quantity[1, "Feet"], Quantity[23, "Feet"]}, {Quantity[2, "Feet"], Quantity[20, "Feet"], Quantity[15, "Feet"], Quantity[15, "Feet"]}, {Quantity[21, "Feet"], Quantity[6, "Feet"], Quantity[3, "Feet"], Quantity[25, "Feet"]}, {Quantity[12, "Feet"], Quantity[24, "Feet"], Quantity[4, "Feet"], Quantity[3, "Feet"]}, {Quantity[1, "Feet"], Quantity[15, "Feet"], Quantity[17, "Feet"], Quantity[5, "Feet"]}}, AxesLabel -> Automatic, TargetUnits -> {"Meters", "Yards", "Feet", "Inches"}]TimeSeries、EventSeries 和 TemporalData 的时间标记将被忽略:
BubbleChart3D[TimeSeries[{{19, 14, 23, 12}, {17, 14, 23, 21}, {22, 9, 8, 14}, {16, 16, 22, 25}, {24, 24, 13, 22}, {24, 11, 2, 3}}, {"May 24, 1982"}]]BubbleChart3D[<|"a" -> {2, 1, 5, 2}, "b" -> {2, 3, 1, 4}, "c" -> {7, 3, 3, 6}, "d" -> {4, 1, 3, 5}|>]BubbleChart3D[<|"a" -> {2, 1, 5, 2}, "b" -> {2, 3, 1, 4}, "c" -> {7, 3, 3, 6}, "d" -> {4, 1, 3, 5}|>, PlotLabels -> Automatic]BubbleChart3D[<|"a" -> {2, 1, 5, 2}, "b" -> {2, 3, 1, 4}, "c" -> {7, 3, 3, 6}, "d" -> {4, 1, 3, 5}|>, PlotLegends -> Automatic, PlotStyle -> {Hue[0.61, 0.7, 1], Hue[0.17, 0.4, 0.65], Hue[0.64, 0.5, 0.75], Hue[0.45, 0.4, 0.7]}]BubbleChart3D[<|"a" -> <|"x" -> 2, "y" -> 1, "z" -> 5, "u" -> 2|>, "b" -> <|"x" -> 2, "y" -> 3, "z" -> 1, "u" -> 4|>, "c" -> <|"x" -> 7, "y" -> 3, "z" -> 3, "u" -> 6|>, "d" -> <|"x" -> 4, "y" -> 1, "z" -> 3, "u" -> 5|>|>, PlotLegends -> Automatic, PlotStyle -> {Hue[0.61, 0.7, 1], Hue[0.17, 0.4, 0.65], Hue[0.64, 0.5, 0.75], Hue[0.45, 0.4, 0.7]}, AxesLabel -> Automatic]BubbleChart3D[<|"group1" -> <|"a" -> {2, 1, 5, 2}, "b" -> {2, 3, 1, 4}, "c" -> {7, 3, 3, 6}, "d" -> {4, 1, 3, 5}|>, "group2" -> <|"a" -> {2, 3, 8, 1}, "b" -> {1, 3, 2, 6}, "c" -> {5, 3, 3, 6}, "d" -> {4, 2, 6, 6}|>|>, PlotLegends -> Automatic, PlotStyle -> {Hue[0.08, 1, 1], Hue[0.17, 0.8, 0.5], Hue[0, 1, 0.8], Hue[0.06, 1, 0.8]}]WeightedData 中的权值将被忽略:
BubbleChart3D[WeightedData[{{6, 17, 16, 1}, {15, 15, 16, 8}, {19, 15, 10, 5}, {13, 11, 4, 8}, {8, 20, 5, 15}, {17, 3, 7, 2}}, {0.4, 0.2, 0.6, 0.3, 0.4, 0.3}]]{d1, d2, d3} = {{1, 1, 1, 1}, {2, 1, 1, 1}, {3, 1, 1, 1}};
{e1, e2, e3} = {{1, 2, 2, 1}, {2, 2, 2, 1}, {3, 2, 2, 1}};{BubbleChart3D[{{d1, d2, d3}, {e1, Style[e2, RGBColor[0.93, 0.27, 0.27]], e3}}], BubbleChart3D[{{d1, d2, d3}, Style[{e1, e2, e3}, RGBColor[0.93, 0.27, 0.27]]}], BubbleChart3D[Style[{{d1, d2, d3}, {e1, e2, e3}}, RGBColor[0.93, 0.27, 0.27]]]}{d1, d2, d3} = {{1, 1, 1, 1}, {2, 1, 1, 1}, {3, 1, 1, 1}};
{e1, e2, e3} = {{1, 2, 2, 1}, {2, 2, 2, 1}, {3, 2, 2, 1}};{BubbleChart3D[{{d1, d2, d3}, {e1, Style[e2, RGBColor[0.93, 0.27, 0.27]], e3}}, PlotStyle -> GrayLevel[0.62]], BubbleChart3D[{{d1, d2, d3}, Style[{e1, Style[e2, RGBColor[0.93, 0.27, 0.27]], e3}, RGBColor[0.14, 0.8, 0.14]]}, PlotStyle -> GrayLevel[0.62]], BubbleChart3D[Style[{{d1, d2, d3}, Style[{e1, Style[e2, RGBColor[0.93, 0.27, 0.27]], e3}, RGBColor[0.14, 0.8, 0.14]]}, RGBColor[0.4, 0.6, 1]], PlotStyle -> GrayLevel[0.62]]}BubbleChart3D[{{1, 1, 1, 1}, Tooltip[{2, 2, 2, 2}, "median"], {3, 3, 3, 3}}]BubbleChart3D[Table[Tooltip[{CountryData[c, #]& /@ {"Area", "GovernmentConsumption", "GDP", "Population"}}, CountryData[c, "Flag"]], {c, CountryData["G8"]}], ImageSize -> Medium]用 PopupWindow 提供其它的向下钻取的信息:
BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, PopupWindow[{3, 3, 3, 3}, DateListPlot[FinancialData["IBM", "Jan. 1, 2004"]]]}]Button 可以用于触发任何行为:
BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, Button[{3, 3, 3, 3}, Speak[2]]}]表格数据 (3)
cars = ResourceData["Sample Tabular Data: Car Models"]BubbleChart3D[cars -> {"displacement", "weight", "horsepower", "mpg"}]pivot = PivotToColumns[cars, "origin" -> "mpg"]BubbleChart3D[pivot -> {{"displacement", "weight", "horsepower", ExtendedKey["mpg", "europe"]}, {"displacement", "weight", "horsepower", ExtendedKey["mpg", "japan"]}, {"displacement", "weight", "horsepower", ExtendedKey["mpg", "usa"]}}, PlotLegends -> {"Europe", "Japan", "USA"}]绘制 TimeSeries 或 EventSeries 中所有分量的值:
BubbleChart3D[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> True, "Count" -> 5,
"Endpoints" -> TabularColumn[Association[
"Data" -> {2, {{NumericArray[{20563, -2147483648}, "Integer32"], {},
DataStructure["BitVec ... TabularColumn[Association["Data" -> {{3, 2, 2, 1, 1}, {}, None},
"ElementType" -> "Integer64"]], TabularColumn[Association[
"Data" -> {{1, 2, 1, 5, 3}, {}, None}, "ElementType" -> "Integer64"]]}}]]]],
Association[]]]绘制 TimeSeries 或 EventSeries 中一个分量的值:
ts = TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> True, "Count" -> 10,
"Endpoints" -> TabularColumn[Association[
"Data" -> {2, {{NumericArray[{20563, -2147483648}, "Integer32"], {},
DataStructure["BitVe ... 4557913726,
54.91958809978361, 63.166118763886644, 49.626260528201, 66.72362173609423,
36.22977790380919, 45.64568338043069, 77.30906172879072}, {}, None},
"ElementType" -> "Real64"]]}}]]]], Association[]];BubbleChart3D[ts -> {"a1", "b1", "c1", "d1"}]BubbleChart3D[ts -> {{"a1", "b1", "c1", "d1"}, {"a2", "b2", "c2", "d2"}}]样式和外观 (7)
BubbleChart3D[RandomReal[1, {3, 5, 4}], PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]PlotStyle 可以对所有图表元素设置一个初始样式:
BubbleChart3D[RandomReal[1, {3, 5, 4}], PlotStyle -> <|"Base" -> Opacity[0.6], "Elements" -> {RGBColor[0.855879, 0.665019, 0.302953], RGBColor[0.780926, 0.753979, 0.604883], RGBColor[0.807065, 0.511589, 0.285222]}|>]Style 可以用于屏蔽样式:
BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, Style[{3, 3, 3, 3}, RGBColor[0.93, 0.27, 0.27]], {3, 4, 1, 1}}, PlotStyle -> GrayLevel[0.62]]BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, {3, 3, 3, 3}}, ChartElements -> Graphics3D[Cylinder[]]]ChartElementData["BubbleChart3D"]Table[BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, {3, 3, 3, 3}}, ChartElementFunction -> f, PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}], {f, {"PolyhedronBubble3D", "MarkerBubble3D"}}]BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, {3, 3, 3, 3}}, ChartElementFunction -> ChartElementDataFunction["MarkerBubble3D", "Shape" -> "Cylinder", "Marker" -> "Cuboid", "MarkerColor" -> RGBColor[1, 0.75, 0]]]BubbleChart3D[RandomReal[1, {3, 5, 4}], PlotTheme -> "Marketing"]BubbleChart3D[RandomReal[1, {3, 5, 4}], PlotTheme -> "Web"]标签和图例 (7)
用 Labeled 对一个气泡添加标签:
BubbleChart3D[{{1, 1, 1, 1}, Labeled[{2, 2, 2, 2}, Framed["label", FrameMargins -> 1, Background -> RGBColor[1, 0.75, 0]], Left], {3, 3, 3, 3}}]Table[BubbleChart3D[{{1, 1, 1, 1}, Labeled[{2, 2, 2, 2}, "label", p], {3, 3, 3, 3}}, BubbleSizes -> {0.2, 0.4}, PlotLabel -> p, Ticks -> None], {p, {Bottom, Center, Top}}]BubbleChart3D[{{{1, 1, 1, 1}, {2, 2, 2, 2}}, {{3, 3, 3, 3}, {4, 4, 4, 4}}}, PlotLabels -> <|"Elements" -> {"c1", "c2"}|>]用 LabelingFunction 对气泡提供值标签:
BubbleChart3D[{{{1, 1, 1, 1}, {2, 2, 2, 2}}, {{3, 3, 3, 3}, {4, 4, 4, 4}}}, PlotRange -> All, LabelingFunction -> Above]用 Placed 控制位置和格式:
labeler[v_, {i_, j_}, {ri_, cj_}] := Placed[{v, ri[[1]], cj[[1]]}, Tooltip, Row[#, ","]&]BubbleChart3D[{{{1, 1, 1, 1}, {2, 2, 2, 2}}, {{3, 3, 3, 3}, {4, 4, 4, 4}}}, PlotLabels -> <|"Groups" -> {"r1", "r2"}, "Elements" -> {"c1", "c2", "c3"}|>, FaceGrids -> None, PlotRange -> All, LabelingFunction -> labeler]BubbleChart3D[RandomReal[1, {2, 3, 4}], PlotLegends -> <|"Groups" -> {"data1", "data2"}|>, PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}]用 Legended 增加其它图例项:
BubbleChart3D[{{{1, 1, 1, 1}, Legended[Style[{2, 2, 2, 2}, RGBColor[0.93, 0.27, 0.27]], "extra"]}, {{3, 3, 3, 3}, {4, 4, 4, 4}}}, PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}, PlotLegends -> {"aaa", "bbb"}]用 Placed 影响图例坐标:
Table[BubbleChart3D[{{{1, 1, 1, 1}, {2, 2, 2, 2}}, {{3, 3, 3, 3}, {4, 4, 4, 4}}}, PlotLegends -> Placed[{"data1", "data2"}, p], PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}], {p, {Below, Above}}]选项 (87)
Axes (3)
默认情况下会为 BubbleChart3D 绘制轴:
BubbleChart3D[IconizedObject[«data»]]BubbleChart3D[IconizedObject[«data»], Axes -> False]{BubbleChart3D[IconizedObject[«data»], Axes -> {True, False, False}], BubbleChart3D[IconizedObject[«data»], Axes -> {False, True, False}], BubbleChart3D[IconizedObject[«data»], Axes -> {False, False, True}]}AxesOrigin (2)
AxesStyle (4)
BubbleChart3D[IconizedObject[«data»], AxesStyle -> RGBColor[0.93, 0.27, 0.27]]BubbleChart3D[IconizedObject[«data»], AxesStyle -> {{Thick, RGBColor[0.67, 0.54, 0.42]}, {Thick, RGBColor[0.4, 0.6, 1]}, {Thick, RGBColor[0.14, 0.8, 0.14]}}]BubbleChart3D[IconizedObject[«data»], AxesStyle -> RGBColor[0.14, 0.8, 0.14], TicksStyle -> RGBColor[0.4, 0.6, 1]]BubbleChart3D[IconizedObject[«data»], AxesStyle -> RGBColor[0.14, 0.8, 0.14], LabelStyle -> RGBColor[0.4, 0.6, 1]]AxesLabel (4)
BubbleChart3D[IconizedObject[«data»], Axes -> True]BubbleChart3D[IconizedObject[«data»], Axes -> True, AxesLabel -> "Z-axis"]BubbleChart3D[IconizedObject[«data»], Axes -> True, AxesLabel -> {"X", "Y", "Z"}]BubbleChart3D[QuantityArray[IconizedObject[«data»], "Meters"]
, Axes -> True, AxesLabel -> Automatic]BubbleScale (2)
BubbleSizes (1)
ChartElementFunction (5)
获得 ChartElementFunction 的内置设置的列表:
ChartElementData["BubbleChart3D"]data = {{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}};Table[BubbleChart3D[data, ChartElementFunction -> f, PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}, PlotLabel -> f], {f, {"Bubble3D", "MarkerBubble3D"}}]Table[BubbleChart3D[data, ChartElementFunction -> f, PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}, PlotLabel -> f], {f, {"ProfileCube", "PolyhedronBubble3D"}}]写入一个自定义的 ChartElementFunction:
f[{{xmin_, xmax_}, {ymin_, ymax_}, {zmin_, zmax_}}, v_, meta_] :=
{Cuboid[{xmin, ymin, zmin}, {xmax, ymax, zmax}]}BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, ChartElementFunction -> f]DataDrilldownBubble[box_, v_, {meta_}] :=
PopupWindow[ChartElementData["Cylinder"][box, v, {}], PieChart[meta]]DataDrilldownBubble[box_, v_, ___] :=
ChartElementData["Cube"][box, v]BubbleChart3D[{{1, 0, 1, 1} -> Range[5], {0, 1, 2, 2}, {2, 2, 3, 3} -> RandomReal[1, 10]}, ChartElementFunction -> DataDrilldownBubble]内置的基本函数可能有选项,用 面板 ▶ 图表元素方案 设置它们:
ChartElementData["MarkerBubble3D", "Options"]Table[BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, ChartElementFunction -> ChartElementDataFunction["MarkerBubble3D", "Shape" -> s[[1]], "Marker" -> s[[2]], "MarkerColor" -> RGBColor[1, 0.75, 0]]], {s, {{"Sphere", "Cylinder"}, {"Cuboid", "Sphere"}}}]ChartElements (6)
创建基于任何 Graphics3D 对象的绘图图表:
BubbleChart3D[{{1, 2, 3, 4}, {3, 2, 1, 3}, {3, 1, 1, 2}}, ChartElements -> Graphics3D[Cone[]]]data = RandomReal[1, {3, 4}];{data1, data2, data3} = {data, data + 1, data + 2};BubbleChart3D[{data1, data2, data3}, ChartElements -> {[image], [image], [image]}]BubbleChart3D[{data1, data2, data3}, ChartElements -> {{[image], [image], [image]}, None}]BubbleChart3D[Table[{i, i, i, 1}, {i, 5}], ChartElements -> {[image], [image]}]样式可以继承 PlotStyle 等样式:
BubbleChart3D[RandomReal[1, {3, 5, 4}], ChartElements -> [image], PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}]用 Style 屏蔽单个样式:
BubbleChart3D[{{{1, 2, 3, 4}, Style[{3, 2, 1, 3}, RGBColor[0.93, 0.27, 0.27]], {3, 1, 1, 2}}}, BubbleSizes -> {0.2, 0.4}, ChartElements -> [image], PlotStyle -> GrayLevel[0.62]]BubbleChart3D[{{{1, 2, 3, 4}, {3, 2, 1, 3}, {3, 1, 1, 2}}}, BubbleSizes -> {0.2, 0.4}, ChartElements -> [image], PlotStyle -> GrayLevel[0.62]]ColorFunction (4)
BubbleChart3D[RandomInteger[10, {2, 10, 4}], ColorFunction -> Function[{x, y, z, r}, Lighter[RGBColor[0.14, 0.8, 0.14], x]]]用 ColorFunctionScaling->False,获得未缩放的高度值:
BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, ColorFunction -> Function[{x, y, z, r}, Switch[{x, y, z, r}, {1, 0, 1, 1}, RGBColor[1, 0.75, 0], {0, 1, 2, 2}, RGBColor[0.98, 0.56, 0.17], {2, 2, 3, 3}, RGBColor[0.93, 0.27, 0.27]]], ColorFunctionScaling -> False]ColorFunction 屏蔽 PlotStyle 中的样式:
BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, PlotStyle -> RGBColor[0.14, 0.8, 0.14], ColorFunction -> "SolarColors"]用 ColorFunction 组合不同样式效果:
BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, PlotStyle -> <|"Elements" -> {Opacity[0.2], Specularity[1, 20], Glow[RGBColor[0.93, 0.27, 0.27]]}|>, ColorFunction -> (RGBColor[0.4, 0.6, 1]&)]ColorFunctionScaling (2)
BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, {3, 3, 3, 3}}, ColorFunction -> Function[{x, y, z, r}, GrayLevel[r]]]用 ColorFunctionScaling->False 得到未缩放的高度值:
BubbleChart3D[{{1, 2, 3, 4}, {3, 2, 1, 3}, {3, 1, 1, 2}}, ColorFunction -> Function[{x, y, z, r}, Switch[{x, y, z, r}, {1, 2, 3, 4}, RGBColor[1, 0.75, 0], {3, 2, 1, 3}, RGBColor[0.98, 0.56, 0.17], {3, 1, 1, 2}, RGBColor[0.93, 0.27, 0.27]]], ColorFunctionScaling -> False]ImageSize (7)
使用有名称的尺寸如 Tiny、Small、Medium 和 Large:
{BubbleChart3D[IconizedObject[«data»], ImageSize -> Tiny], BubbleChart3D[IconizedObject[«data»], ImageSize -> Small]}{BubbleChart3D[IconizedObject[«data»], ImageSize -> 150], BubbleChart3D[IconizedObject[«data»], AspectRatio -> 1.5, ImageSize -> 150]}{BubbleChart3D[IconizedObject[«data»], ImageSize -> {Automatic, 150}], BubbleChart3D[IconizedObject[«data»], AspectRatio -> 2, ImageSize -> {Automatic, 150}]}{BubbleChart3D[IconizedObject[«data»], ImageSize -> UpTo[200]], BubbleChart3D[IconizedObject[«data»], AspectRatio -> 2, ImageSize -> UpTo[200]]}BubbleChart3D[IconizedObject[«data»], ImageSize -> {200, 200}, Background -> RGBColor[0.4, 0.6, 1]]设置 AspectRatioFull 将填充可用空间:
BubbleChart3D[IconizedObject[«data»], AspectRatio -> Full, ImageSize -> {200, 200}, Background -> RGBColor[0.4, 0.6, 1]]{BubbleChart3D[IconizedObject[«data»], ImageSize -> {UpTo[200], UpTo[150]}], BubbleChart3D[IconizedObject[«data»], AspectRatio -> 2, ImageSize -> {UpTo[200], UpTo[150]}]}设置 ImageSizeFull 可填充对象中的可用空间:
Framed[Pane[BubbleChart3D[IconizedObject[«data»], ImageSize -> Full, Background -> RGBColor[0.4, 0.6, 1]], {200, 100}]]Framed[Pane[BubbleChart3D[IconizedObject[«data»], AspectRatio -> Full, ImageSize -> {Scaled[0.5], Scaled[0.5]}, Background -> RGBColor[0.4, 0.6, 1]], {200, 200}]]LabelingFunction (7)
Tooltip 和 StatusArea 使用自动标签值:
BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, LabelingFunction -> Automatic]BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, LabelingFunction -> None]用 Placed 控制标签坐标:
Table[BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, LabelingFunction -> p, PlotLabel -> p, Ticks -> None], {p, {Bottom, Center, Top}}]Table[BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, LabelingFunction -> p, PlotLabel -> p, Ticks -> None], {p, {Left, Right}}]Table[BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, LabelingFunction -> p, PlotLabel -> p, Ticks -> None], {p, {Below, Above}}]Table[BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, PlotRange -> All, LabelingFunction -> p, PlotLabel -> p, Ticks -> None], {p, {Before, After}}]Table[BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, PlotRange -> All, LabelingFunction -> p, PlotLabel -> p, Ticks -> None], {p, {{0, 0, 0}, {0.5, 0.5, 0.5}, {1, 1, 1}}}]BubbleChart3D[{{1, 0, 1, 1}, {0, 1, 2, 2}, {2, 2, 3, 3}}, PlotRange -> All, LabelingFunction -> (Placed[MatrixForm[#1], Tooltip]&)]bubbleLabel[v : {x_, y_, z_, w_}, level_, {r_, c_}] := Placed[Grid[{{Row[{r[[1]], c[[1]], "Fund"}, " "], SpanFromLeft}, {"Age", x}, {"Return %", y}, {"Expense %", z}, {"Market Cap", w}}, Frame -> All, Alignment -> Left], Tooltip]data = {{{1, 11, 1.5, 300}, {2, 50, 0.12, 200}, {3, 20, 1.2, 300}}, {{6, 20, 1.5, 300}, {2, 8, 1.1, 600}, {6, 16, 0.5, 500}}};BubbleChart3D[data, PlotLabels -> <|"Groups" -> {"Growth", "Value"}, "Elements" -> Placed[{"Small-Cap", "Mid-Cap", "Large-Cap"}, None]|>, LabelingFunction -> bubbleLabel]PerformanceGoal (1)
data = RandomReal[1, {3, 5, 4}];BubbleChart3D[data, PerformanceGoal -> "Quality"]BubbleChart3D[data, PerformanceGoal -> "Speed"]Table[ByteCount@BubbleChart3D[data, PerformanceGoal -> p], {p, {"Quality", "Speed"}}]PlotInteractivity (4)
BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, {3, 3, 3, 3}}]BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, {3, 3, 3, 3}}, PlotInteractivity -> False]BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, Tooltip[{3, 3, 3, 3}, "hello"]}, PlotInteractivity -> False]BubbleChart3D[{{1, 1, 1, 1}, {2, 2, 2, 2}, Tooltip[{3, 3, 3, 3}, "hello"]}, PlotInteractivity -> <|"User" -> True, "System" -> False|>]PlotLabels (8)
BubbleChart3D[RandomReal[1, {4, 4}], PlotLabels -> {"a", "b", "c", "d"}]{BubbleChart3D[RandomReal[1, {3, 4}], PlotLabels -> {"c1", "c2", "c3"}],
BubbleChart3D[RandomReal[1, {3, 3, 4}], PlotLabels -> {"r1", "r2", "r3"}]}BubbleChart3D[RandomReal[1, {2, 3, 4}], PlotLabels -> <|"Elements" -> {"c1", "c2", "c3"}|>]BubbleChart3D[RandomReal[1, {2, 3, 4}], PlotLabels -> <|"Groups" -> {"r1", "r2"}, "Elements" -> {"c1", "c2", "c3"}|>]数据中的 Labeled 封装将会放置额外的标签:
data = {{1, 0, 1, 1}, Labeled[{0, 1, 1, 2}, "label", Below], {2, 2, 2, 3}};BubbleChart3D[data, PlotLabels -> {"a", "b", "c"}]用 Placed 控制标签的放置:
data = {{1, 1, 0, 1}, {1, 0, 1, 2}, {0, 2, 2, 3}};BubbleChart3D[data, PlotLabels -> <|"Groups" -> Placed[{"r1", "r2"}, Center], "Elements" -> Placed[{"c1", "c2", "c3"}, Below]|>]Table[BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, PlotLabels -> Placed[{"a", "b", "c"}, p], PlotLabel -> p, Ticks -> None], {p, {Below, Above}}]Table[BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, PlotLabels -> Placed[{"a", "b", "c"}, p], PlotLabel -> p, Ticks -> None], {p, {Before, After}}]Table[BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, PlotLabels -> Placed[{"aa", "bb", "cc"}, p], PlotLabel -> p], {p, {{0, 0, 0}, {1 / 2, 1 / 2, 1 / 2}, {1, 1, 1}}}]Table[BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, PlotLabels -> Placed[Framed /@ {"aa", "bb", "cc"}, {{1, 1, 1}, p}], Ticks -> None, PlotLabel -> p], {p, {{0, 0}, {1 / 2, 1 / 2}, {1, 1}}}]用 Placed 的第三个参数控制格式:
BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, BubbleSizes -> {0.3, 0.4}, PlotLabels -> Placed[{"aaa", "bbb", "ccc"}, Center, Rotate[#, 45Degree]&]]BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, BubbleSizes -> {0.3, 0.4}, PlotLabels -> Placed[{"aaa", "bbb", "ccc"}, Center, Panel[#, FrameMargins -> 0]&]]BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, PlotLabels -> Placed[{"aaa", "bbb", "ccc"}, Center, Hyperlink[#, "http://www.wolfram.com"]&]]BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, PlotLabels -> Placed[{"aaa", "bbb", "ccc"}, Center, Rotate[#, Pi / 4]&]]BubbleChart3D[RandomReal[1, {2, 3, 4}], PlotLabels -> <|"Groups" -> Placed[{"r1", "r2"}, Above], "Elements" -> Placed[{"c1", "c2", "c3"}, Center]|>]用 Placed 放置多个标签:
BubbleChart3D[{{1, 1, 0, 1}, {1, 0, 1, 2}, {2, 2, 1, 3}}, BubbleSizes -> {0.4, 0.6}, PlotLabels -> Placed[{{"a", "b", "c"}, {"x", "y", "z"}}, {Top, Bottom}, Framed[#, FrameMargins -> 1, Background -> RGBColor[1, 0.75, 0]]&]]PlotLegends (7)
data = {{{1, 0, 0, 3}, {0, 1, 0, 2}, {1, 2, 0, 3}}, {{5, 4, 1, 5}, {4, 5, 1, 6}, {5, 6, 1, 5}}};BubbleChart3D[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]}|>]BubbleChart3D[data, PlotLegends -> <|"Groups" -> {"rr1", "rr2"}|>, PlotStyle -> <|"Groups" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}|>]用 Legended 添加其他图例:
data = {{{1, 0, 0, 3}, Legended[Style[{0, 1, 0, 2}, RGBColor[0.93, 0.27, 0.27]], "aa"], {1, 2, 0, 3}}, {{5, 4, 1, 1}, {4, 5, 1, 6}, {5, 6, 1, 5}}};BubbleChart3D[data, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>, PlotLegends -> <|"Elements" -> {"ccc1", "ccc2", "ccc3"}|>]用 Legended 指定几个图例:
data = {{1, 0, 0, 3}, Legended[{0, 1, 0, 2}, "aa"], {1, 2, 0, 3}, {5, 4, 1, 5}, Legended[{4, 5, 1, 6}, "bb"], {2, 6, 1, 5}};BubbleChart3D[data, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.8750956, 0.6580038, 0.746929], RGBColor[0.9440982, 0.7955892, 0.5942686], RGBColor[0.9537862, 0.937389, 0.6180996], RGBColor[0.7952328000000001, 0.8988539999999999, 0.8302508], RGBColor[0.431296, 0.709773, 0.927077]}|>]data = {{{1, 0, 0, 3}, {0, 1, 0, 2}, {1, 2, 0, 3}}, {{5, 4, 1, 5}, {4, 5, 1, 6}, {2, 6, 1, 5}}};BubbleChart3D[data, PlotLegends -> <|"Groups" -> {"Group A", "Group B"}|>, PlotStyle -> <|"Groups" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}|>]data = {{{1, 0, 0, 3}, {0, 1, 0, 2}, {1, 2, 0, 3}}, {{5, 4, 1, 5}, {4, 5, 1, 6}, {2, 6, 1, 5}}};BubbleChart3D[data, PlotLegends -> <|"Groups" -> {"Group A", "Group B", "Group C"}|>, PlotStyle -> <|"Groups" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}|>]data = {{{1, 0, 0, 3}, {0, 1, 0, 2}, {1, 2, 0, 3}}, {{5, 4, 1, 5}, {4, 5, 1, 6}, {2, 6, 1, 5}}};BubbleChart3D[data, PlotLegends -> <|"Groups" -> {"Test A", "Test B"}, "Elements" -> {"John", "Mary", "Bob"}|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}, "Groups" -> {Opacity[0.2], Opacity[0.9]}|>]用 Placed 控制图例的放置:
data = {{{1, 0, 0, 3}, {0, 1, 0, 2}, {1, 2, 0, 3}}, {{5, 4, 1, 5}, {4, 5, 1, 6}, {2, 6, 1, 5}}};Table[BubbleChart3D[data, PlotLegends -> <|"Elements" -> Placed[{"John", "Mary", "Bob"}, pos]|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>], {pos, {Below, Above, Before, After}}]PlotStyle (10)
BubbleChart3D[{{1, 2, 3, 10}, {3, 2, 1, 7}, {3, 1, 1, 3}, {1, 1, 1, 1}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1], RGBColor[1, 0.75, 0]}]BubbleChart3D[{{1, 2, 3, 10}, {3, 2, 1, 7}, {3, 1, 1, 3}, {1, 1, 1, 1}}, PlotStyle -> Opacity[0.4]]BubbleChart3D[RandomReal[1, {3, 5, 4}], PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]BubbleChart3D[{{1, 2, 3, 10}, {3, 2, 1, 7}, {3, 1, 1, 3}}, PlotStyle -> <|"Elements" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14]}|>]data = {RandomReal[{1, 2}, {3, 4}], RandomReal[{2, 3}, {3, 4}]};BubbleChart3D[data, PlotStyle -> <|"Elements" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}|>]BubbleChart3D[data, PlotStyle -> <|"Groups" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14]}|>]BubbleChart3D[data, PlotStyle -> <|"Base" -> {Specularity[White, 100]}|>]BubbleChart3D[data, PlotStyle -> <|"Groups" -> {Opacity[.2], Opacity[.9]}, "Elements" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}|>]当同时为元素和数据组指定样式时,元素的样式可能会覆盖组的样式:
data = {RandomReal[{1, 2}, {3, 4}], RandomReal[{2, 3}, {3, 4}]};BubbleChart3D[data, PlotStyle -> <|"Elements" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}, "Groups" -> {RGBColor[1, 0.75, 0], RGBColor[0.95, 0.43, 0.96]}|>]BubbleChart3D[{{1, 2, 3, 4}, Style[{3, 2, 1, 3}, Opacity[0.3]], {3, 1, 1, 2}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]BubbleChart3D[{{1, 2, 3, 4}, Style[{3, 2, 1, 3}, RGBColor[1, 0.75, 0]], {3, 1, 1, 2}, {1, 1, 1, 1}}, BubbleSizes -> {0.1, 0.5}, PlotStyle -> GrayLevel[0.62]]可组合使用 ColorFunction 的 PlotStyle 的样式:
BubbleChart3D[RandomReal[1, {3, 4}], PlotStyle -> Opacity /@ {0.1, 0.4, 0.7}, ColorFunction -> (Blend[{RGBColor[0.4, 0.6, 1], RGBColor[0.93, 0.27, 0.27]}, #]&)]ColorFunction 可能会覆盖 PlotStyle 的设置:
BubbleChart3D[RandomReal[1, {3, 4}], PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}, ColorFunction -> "SolarColors"]ChartElements 可能会覆盖 PlotStyle 的设置:
BubbleChart3D[{{{1, 2, 3, 4}, {3, 2, 1, 3}, {3, 1, 1, 2}}}, BubbleSizes -> {0.2, 0.4}, ChartElements -> [image], PlotStyle -> GrayLevel[0.62]]PlotTheme (2)
Ticks (6)
BubbleChart3D[IconizedObject[«data»]]BubbleChart3D[IconizedObject[«data»], Ticks -> None]BubbleChart3D[IconizedObject[«data»], Ticks -> {{.5, 1, 1.5}, {.5, 1, 1.5}, {.5, 1, 1.5}}]BubbleChart3D[IconizedObject[«data»], Ticks -> {{{.5, a}, {1, b}, {1.5, c}}, {{.5, a}, {1, b}, {1.5, c}}, {{.5, a}, {1, b}, {1.5, c}}}]BubbleChart3D[IconizedObject[«data»], Ticks -> {{{.5, a, .22}, {1, b, .11}, {1.5, c, .2}}, {{.5, a, .22}, {1, b, .13}, {1.5, c, .08}}, {{.5, a, .1}, {1, b, .1}, {1.5, c, .1}}}]BubbleChart3D[IconizedObject[«data»], Ticks -> {{{.5, a, .22, Directive[RGBColor[0.4, 0.6, 1]]}, {1, b, .11, Directive[RGBColor[0.4, 0.6, 1], Thick]}, {1.5, c, .2, Directive[RGBColor[0.4, 0.6, 1], Thick, Dashed]}}, {{.5, a, .22, Directive[RGBColor[0.93, 0.27, 0.27]]}, {1, b, .13, Directive[RGBColor[0.93, 0.27, 0.27], Thick]}, {1.5, c, .08, Directive[RGBColor[0.93, 0.27, 0.27], Thick, Dashed]}}, {{.5, a, .1, Directive[RGBColor[0.14, 0.8, 0.14]]}, {1, b, .1, Directive[RGBColor[0.14, 0.8, 0.14], Thick]}, {1.5, c, .1, Directive[RGBColor[0.14, 0.8, 0.14], Thick]}}}]TicksStyle (2)
BubbleChart3D[IconizedObject[«data»], TicksStyle -> Directive[Bold, RGBColor[0.93, 0.27, 0.27]]]BubbleChart3D[IconizedObject[«data»], TicksStyle -> {Directive[RGBColor[0.14, 0.8, 0.14], Bold], Directive[Bold, RGBColor[0.93, 0.27, 0.27]], Directive[Bold, RGBColor[0.4, 0.6, 1]]}]应用 (2)
countries = CountryData["G15"];
properties = {"GDPPerCapita", "PovertyFraction", "MilitaryExpenditureFraction", "Population"};data = Table[With[{v = cp}, Button[v[[2 ;; 5]], Speak[StringJoin[ToString /@ {v[[1]], ", GDP per capita: $", Round[v[[2]]], ", Poverty Fraction: ", v[[3]], ", Military Expenditure Fraction: ", v[[4]], ", Population: ", Round[v[[5]]]}]]]], {cp, Table[Prepend[Table[CountryData[c, p], {p, properties}], c], {c, countries}]}];BubbleChart3D[data, PlotStyle -> ColorData["Rainbow"] /@ Range[0, 1, 1 / Length[data]]]countries = {"US", "France", "China", "India", "Iran", "Afghanistan", "Cameroon", "Brazil", "Russia", "Canada"};
properties = {"PovertyFraction", "GDPPerCapita", "MilitaryExpenditureFraction", "Population"};
data = Table[CountryData[c, p], {c, countries}, {p, properties}];labeler[v_, {r_, c_}, {rowLabels_, colLabels_}] := Placed[Grid[Prepend[Table[{properties[[i]], v[[i]]}, {i, Length[v]}], {Style[countries[[c]], Bold, 12], }], Alignment -> Left], Tooltip]BubbleChart3D[data, ViewPoint -> {2.19, -1.93, 1.72}, ImageSize -> 400, PlotLegends -> countries, AxesLabel -> properties[[1 ;; 3]], LabelingFunction -> labeler, PlotStyle -> {RGBColor[0.9215686274509803, 0.49411764705882355, 0.43137254901960786], RGBColor[1., 0.7215686274509804, 0.2196078431372549], RGBColor[0.9490196078431372, 0.8627450980392157, 0.43529411764705883], RGBColor[0.6705882352941176, 0.8784313725490196, 0.9372549019607843], RGBColor[0.3176470588235294, 0.6549019607843137, 0.7529411764705882], RGBColor[0.12941176470588237, 0.5176470588235295, 0.6313725490196078], RGBColor[0.09019607843137255, 0.33725490196078434, 0.49411764705882355], RGBColor[0.7058823529411765, 0.49411764705882355, 0.5450980392156862], RGBColor[0.5333333333333333, 0.23529411764705882, 0.3058823529411765], RGBColor[0.8941176470588236, 0.7098039215686275, 0.7490196078431373]}]属性和关系 (1)
用 BubbleChart3D 获得三维的气泡图:
{BubbleChart[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}], BubbleChart3D[{{3, 4, 1, 4}, {3, 6, 1, 3}, {4, 3, 1, 5}}]}巧妙范例 (1)
ColorData[12] /@ Range[10]BubbleChart3D[RandomReal[10, {75, 4}], Axes -> None, Boxed -> False, FaceGrids -> None, PerformanceGoal -> "Speed", ChartElementFunction -> "FadingCube", PlotStyle -> <|"Elements" -> {RGBColor[0.6235294117647059, 0.1450980392156863, 0.12549019607843137], RGBColor[0.6588235294117647, 0.3058823529411765, 0.17254901960784313], RGBColor[0.24313725490196078, 0.11764705882352941, 0.058823529411764705], RGBColor[0.9450980392156862, 0.7529411764705882, 0.6352941176470588], RGBColor[0.8392156862745098, 0.4745098039215686, 0.21176470588235294], RGBColor[0.8274509803921568, 0.7254901960784313, 0.43529411764705883], RGBColor[0.44313725490196076, 0.4980392156862745, 0.5490196078431373], RGBColor[0.24705882352941178, 0.30980392156862746, 0.37254901960784315], RGBColor[0.16862745098039217, 0.23921568627450981, 0.3803921568627451], RGBColor[0.2980392156862745, 0.17647058823529413, 0.19607843137254902]}, "Base" -> EdgeForm[None]|>, BoxRatios -> {1.2, 1, 1}]文本
Wolfram Research (2008),BubbleChart3D,Wolfram 语言函数,https://reference.wolfram.com/language/ref/BubbleChart3D.html (更新于 2025 年).
CMS
Wolfram 语言. 2008. "BubbleChart3D." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2025. https://reference.wolfram.com/language/ref/BubbleChart3D.html.
APA
Wolfram 语言. (2008). BubbleChart3D. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/BubbleChart3D.html 年
BibTeX
@misc{reference.wolfram_2026_bubblechart3d, author="Wolfram Research", title="{BubbleChart3D}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/BubbleChart3D.html}", note=[Accessed: 19-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_bubblechart3d, organization={Wolfram Research}, title={BubbleChart3D}, year={2025}, url={https://reference.wolfram.com/language/ref/BubbleChart3D.html}, note=[Accessed: 19-August-2026]}