ListDensityPlot3D[farr]
根据数值数组 farr 生成平滑的密度图.
ListDensityPlot3D[{{x1,y1,z1,f1},…,{xn,yn,zn,fn}}]
在指定的点 {xi,yi,zi} 生成值为 fi 的密度图.
ListDensityPlot3D
ListDensityPlot3D[farr]
根据数值数组 farr 生成平滑的密度图.
ListDensityPlot3D[{{x1,y1,z1,f1},…,{xn,yn,zn,fn}}]
在指定的点 {xi,yi,zi} 生成值为 fi 的密度图.
更多信息和选项
- ListDensityPlot3D 也被称为容积图.
- ListDensityPlot3D 将给定数据插入到函数
中,然后将数值分别映射到颜色
和不透明度
. - 不透明度函数
通常用于使某些范围的数值可见,而使其他一些数值不可见. - 对于规则数据,函数
在
处有值 farr[[i,j,k]]. - 对于不规则数据,
在
处有值 fi. - 该图直观地显示了一组
,其中
是颜色函数,
为不透明函数,且区域 reg 为规则数据的笛卡尔积
,或不规则数据的 {{x1,y1,z1},…,{xn,yn,zn}} 的凸壳. - farr 应该是一个实数数组; farr 不是实数的位置会被渲染为透明的.
- ListDensityPlot3D[Tabular[…]cspec] 使用列规范 cspec 从表格对象中提取并绘制数值.
- 下列形式的列规范 cspec 可用于绘制表格数据:
-
{colx,coly,colz,colf} 绘制列 f 与列 x、y 和 z 的对比图 - ListDensityPlot3D 线性插值来给出颜色变化.
- ListDensityPlot3D 主要用于连续的值;ArrayPlot3D 用于纯离散值.
- ListDensityPlot3D 有和 Graphics3D 相同的选项,但有如下的增加和改变: [所有选项的列表]
-
Axes True 是否绘制坐标轴 BoxRatios {1,1,1} 三维边框的比例 ColorFunction Automatic 如何给图线着色 ColorFunctionScaling True 是否缩放 ColorFunction 的参数 DataRange Automatic 假设的 x、 y 和 z 取值范围 MaxPlotPoints Automatic 最多包含多少个点 OpacityFunction Automatic 如何计算各个点的不透明度 OpacityFunctionScaling True 是否缩放 OpacityFunction 的参数 PerformanceGoal $PerformanceGoal 优化的目标 PlotLegends None 颜色梯度的图例 PlotRange {Full,Full,Full,Automatic} 要包括的 f 或其它值的范围 PlotTheme $PlotTheme 图线的整体主题 RegionFunction (True&) 如何确定是否包含一个点 ScalingFunctions None 怎样缩放个别坐标 TargetUnits Automatic 要用的单位 - 提供给 ColorFunction 和 OpacityFunction 一个参数,默认情况下为经过缩放的 f 值.
- OpacityFunction 的典型设置包括:
-
Automatic 自动确定 None 不使用不透明度函数,完全不透明 α 不透明度为常数 Opacity[α] Interval[…] 令区间内的值更不透明 "Image3D" Image3D 中使用的默认不透明函数 func 一般不透明度函数 - 提供给 RegionFunction 的参数是 x、 y、 z 和 f.
- 设置 DataRange->{{xmin,xmax},{ymin,ymax},{zmin,zmax}} 在只给定 f 值的 array 作为输入时指定假设的 x、 y 和 z 坐标值的范围.
- 对于一个维度为 {r,s,t} 的 farr,设置 DataRangeAutomatic 等价于 DataRange{{1,r},{1,s},{1,t}}.
- ScalingFunctions 的可能设置包括:
-
{sx,sy,sz} 缩放 x、y 和 z 轴 - 常见的内置缩放函数 s 包括:
-
"Log" 
对数刻度,自动进行标记 "Log10" 
以 10 为底的对数刻度,用 10 的幂进行标记 "SignedLog" 
类似对数的刻度,包含 0 和负数 "Reverse" 
反转坐标的方向
所有选项的列表
范例
打开所有单元 关闭所有单元基本范例 (2)
data = Table[x y z, {z, -1, 1, 2 / 40.}, {y, -1, 1, 2 / 40.}, {x, -1, 1, 2 / 40.}];ListDensityPlot3D[data]data = Table[Sin[x]Cos[y]Sin[z], {z, -5, 5, 0.1}, {y, -5, 5, 0.1}, {x, -5, 5, 0.1}];ListDensityPlot3D[data, ColorFunction -> "TemperatureMap", PlotLegends -> Automatic]范围 (16)
数据 (7)
对于由
值组成的规则数据,
、
和
数据反映了它们在数组中的位置:
data = Table[Sin[x]Cos[y]Sin[z], {z, 0, 2 Pi, 2Pi / 30}, {y, 0, 2Pi, 2Pi / 30}, {x, 0, 2Pi, 2Pi / 30}];ListDensityPlot3D[data]利用 DataRange 显式指定
、
和
数据的范围:
ListDensityPlot3D[data, DataRange -> {{0, 2Pi}, {0, 2Pi}, {0, 2Pi}}]data = Flatten[Table[{x, y, z, ChessboardDistance[{x, y, z}, {0, 0, 0}]}, {z, -1, 1, 2 / 9}, {y, -1, 1, 2 / 9}, {x, -1, 1, 2 / 9}], 2];ListDensityPlot3D[data]对于
这样的不规则数据,则从数据中推断得出
、
和
的数据范围:
pts = RandomPoint[Cuboid[], 10 ^ 3];
data = Table[Append[p, Sqrt[p[[1]] ^ 2 + p[[2]] ^ 2 + p[[3]] ^ 2]], {p, pts}];ListDensityPlot3D[data]用 RegionFunction 来限制数据范围:
data = Table[x y z, {z, -1, 1, 2 / 40.}, {y, -1, 1, 2 / 40.}, {x, -1, 1, 2 / 40.}];ListDensityPlot3D[data, RegionFunction -> Function[{x, y, z}, x ^ 2 + y ^ 2 + z ^ 2 ≤ 1], DataRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]绘制由 SparseArray 给出的值数组的密度:
data = SparseArray[Flatten[Table[{i ^ 2, j ^ 2, k ^ 2} -> i j k, {i, 1, 4}, {j, 1, 4}, {k, 1, 4}]]];ListDensityPlot3D[data]绘制由 QuantityArray 给出的值数组的密度:
data = QuantityArray[Table[x y z, {z, -1, 1, .05}, {y, -1, 1, .05}, {x, -1, 1, .05}], "kg/m^3"];ListDensityPlot3D[data, AxesLabel -> Automatic, PlotLegends -> Automatic, TargetUnits -> {"Feet", "Feet", "Feet", "g/ft^3"}]用 ClipPlanes 指定一个或几个剪切平面. 下例中,剪切平面为
:
data = Table[Sin[x]Cos[y]Sin[z], {z, 0, 2 Pi, 2Pi / 30}, {y, 0, 2Pi, 2Pi / 30}, {x, 0, 2Pi, 2Pi / 30}];ListDensityPlot3D[data, ClipPlanes -> {{-1, 1, -1, 2}}, OpacityFunction -> None, DataRange -> {{0, 2Pi}, {0, 2Pi}, {0, 2Pi}}]表格数据 (1)
演示 (8)
用 PlotTheme 对整体样式进行配置:
data = Table[x y z, {z, -1, 1, .05}, {y, -1, 1, .05}, {x, -1, 1, .05}];Table[ListDensityPlot3D[data, PlotLabel -> t, PlotTheme -> t], {t, {"Minimal", "Scientific", "Marketing"}}]用 PlotLegends 显示不同数值对应的颜色条:
data = Table[x y z, {z, -1, 1, .05}, {y, -1, 1, .05}, {x, -1, 1, .05}];ListDensityPlot3D[data, PlotLegends -> Automatic]用 Axes 控制坐标轴的显示:
data = Table[x y z, {z, -1, 1, .05}, {y, -1, 1, .05}, {x, -1, 1, .05}];Table[ListDensityPlot3D[data, PlotLabel -> a, Axes -> a], {a, {True, False, {True, False, True}}}]用 AxesLabel 对坐标轴进行标注,用 PlotLabel 对整个图线进行标注:
data = Table[x y z, {z, -1, 1, .05}, {y, -1, 1, .05}, {x, -1, 1, .05}];ListDensityPlot3D[data, Ticks -> None, AxesLabel -> {x, y, z}, PlotLabel -> x y z]用 ColorFunction 根据函数值对图线着色:
data = Table[x y z, {z, -1, 1, .05}, {y, -1, 1, .05}, {x, -1, 1, .05}];Table[ListDensityPlot3D[data, PlotLabel -> c, ColorFunction -> c], {c, {Hue, "BlueGreenYellow"}}]data = Table[Sin[π x]Sin[π (y + z)], {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}];ListDensityPlot3D[data, OpacityFunction -> (If[# < 0.7, 1, 0]&)]TargetUnits 指定可视化时用什么单位:
data = QuantityArray[Table[x y z, {z, -1, 1, .05}, {y, -1, 1, .05}, {x, -1, 1, .05}], "kg/m^3"];ListDensityPlot3D[data, AxesLabel -> Automatic, PlotLegends -> Automatic, TargetUnits -> {"Feet", "Feet", "Feet", "g/ft^3"}]在 x 方向使用 ScalingFunctions:
ListDensityPlot3D[Table[Sin[π x]Sin[π (y + z)], {z, -2, 2, 0.05}, {y, -2, 2, 0.05}, {x, -2, 2, 0.05}], ScalingFunctions -> {"Log", None, None}]选项 (38)
BoxRatios (3)
data = Table[Sin[2π x]Sin[2π y]Sin[2π z], {z, -Pi, Pi, 0.1}, {y, -1, 1, 0.1}, {x, -1, 1, 0.1}];ListDensityPlot3D[data]用 BoxRatiosAutomatic 显示三维坐标值的自然缩放:
data = Table[Sin[2π x]Sin[2π y]Sin[2π z], {z, -Pi, Pi, 0.1}, {y, -1, 1, 0.1}, {x, -1, 1, 0.1}];ListDensityPlot3D[data, BoxRatios -> Automatic]data = Table[Sin[2π x]Sin[2π y]Sin[2π z], {z, -Pi, Pi, 0.1}, {y, -1, 1, 0.1}, {x, -1, 1, 0.1}];ListDensityPlot3D[data, BoxRatios -> {5, 2, 3}]ClipPlanes (3)
用 ClipPlanes 指定一个或几个剪切面. 此处,我们剪切
:
data = Table[Sin[x + y + z] / 10, {z, 0, 10, .5}, {y, 0, 10, .5}, {x, 0, 10, .5}];ListDensityPlot3D[data, DataRange -> {{0, 10}, {0, 10}, {0, 10}}, OpacityFunction -> None, ClipPlanes -> {{1, 1, -1, 0}}]data = Table[Sin[x + y + z] / 10, {z, 0, 10, .5}, {y, 0, 10, .5}, {x, 0, 10, .5}];ListDensityPlot3D[data, OpacityFunction -> None, ClipPlanes -> {{1, 1, -1, 0}, {0, 1, 0, -4}}, DataRange -> {{0, 10}, {0, 10}, {0, 10}}]与一般的 RegionFunction 比较:
data = Table[Sin[x + y + z] / 10, {z, 0, 10, .5}, {y, 0, 10, .5}, {x, 0, 10, .5}];ListDensityPlot3D[data, OpacityFunction -> None, RegionFunction -> Function[{x, y, z}, x + y - z ≤ 0], DataRange -> {{0, 10}, {0, 10}, {0, 10}}]ColorFunction (2)
data = Table[Sin[(i + j + k) / 20], {i, 0, 20}, {j, 0, 20}, {k, 0, 20}];ListDensityPlot3D[data, ColorFunction -> Hue]使用 ColorData 中的着色函数:
data = Table[PDF[DirichletDistribution[{1, 2, 3, 4}], {x, y, z}], {z, 0, 1, 0.05}, {y, 0, 1, 0.05}, {x, 0, 1, 0.05}];Table[ListDensityPlot3D[data, ColorFunction -> cf, DataRange -> {{0, 1}, {0, 1}, {0, 1}}], {cf, {"AlpineColors", "Aquamarine", "ArmyColors", "AtlanticColors"}}]ColorFunctionScaling (2)
ColorFunction 的参数通常被缩放至0到1之间:
ListDensityPlot3D[Table[x + y + z, {z, 0, 3, 0.2}, {y, 0, 3, 0.2}, {x, 0, 3, 0.2}], ColorFunction -> Hue]设置 ColorFunctionScaling 为 False,使用未经缩放的坐标:
data = Table[x + y + z, {z, 0, 3, 0.2}, {y, 0, 3, 0.2}, {x, 0, 3, 0.2}];ListDensityPlot3D[data, ColorFunction -> Hue, ColorFunctionScaling -> False]DataRange (2)
data = Table[Exp[-(x ^ 2 + y ^ 2 + z ^ 2)], {z, -1, 1, 1 / 10}, {y, -1, 1, 1 / 20}, {x, -1, 1, 1 / 30}];ListDensityPlot3D[data, DataRange -> Automatic]data = Table[Exp[-(x ^ 2 + y ^ 2 + z ^ 2)], {z, -1, 1, 1 / 10}, {y, -1, 1, 1 / 20}, {x, -1, 1, 1 / 30}];ListDensityPlot3D[data, DataRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]MaxPlotPoints (1)
OpacityFunction (5)
默认情况下,OpacityFunction 设为 Automatic:
data = Table[x ^ 2 + y ^ 2 + z ^ 2, {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}];ListDensityPlot3D[data]用 None 使整个图不透明:
data = Table[Sin[π x]Sin[π (y + z)], {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}];ListDensityPlot3D[data, OpacityFunction -> None]data = Table[Sin[π x]Sin[π (y + z)], {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}];ListDensityPlot3D[data, OpacityFunction -> (If[# < 0.4, 1, 0]&)]data = Table[Sin[π x]Sin[π y] Sin[π z], {z, -1, 1, 0.05}, {y, -1, 1, 0.05}, {x, -1, 1, 0.05}];ListDensityPlot3D[data, OpacityFunction -> Interval[{-1, -0.6}, {0.6, 1}], OpacityFunctionScaling -> False, PlotLegends -> Automatic, DataRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]不透明度为常数 Opacity[0.05]:
data = Table[Sin[π x]Sin[π y] Sin[π z], {z, -1, 1, 0.05}, {y, -1, 1, 0.05}, {x, -1, 1, 0.05}];ListDensityPlot3D[data, OpacityFunction -> 0.05, PlotLegends -> Automatic, DataRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]OpacityFunctionScaling (2)
data = Table[x y z, {z, -5, 5}, {y, -5, 5}, {x, -5, 5}];ListDensityPlot3D[data, OpacityFunction -> Function[f, If[f > 0, 1, 0]]]将 OpacityFunctionScaling 设为 False,使用未经缩放的密度值:
data = Table[x y z, {z, -5, 5}, {y, -5, 5}, {x, -5, 5}];ListDensityPlot3D[data, OpacityFunction -> Function[f, If[f > 0, 1, 0]], OpacityFunctionScaling -> False]PerformanceGoal (2)
data = Table[x y z, {z, -1, 1, .1}, {y, -1, 1, .1}, {x, -1, 1, .1}];Timing[ListDensityPlot3D[data, PerformanceGoal -> "Quality"]]data = Table[x y z, {z, -1, 1, .1}, {y, -1, 1, .1}, {x, -1, 1, .1}];Timing[ListDensityPlot3D[data, PerformanceGoal -> "Speed"]]PlotLegends (2)
data = Table[x y z, {x, -1, 1, 2 / 40.}, {y, -1, 1, 2 / 40.}, {z, -1, 1, 2 / 40.}];ListDensityPlot3D[data]用 PlotLegends->Automatic 显示图例:
data = Table[x y z, {z, -1, 1, 2 / 40.}, {y, -1, 1, 2 / 40.}, {x, -1, 1, 2 / 40.}];ListDensityPlot3D[data, PlotLegends -> Automatic]PlotRange (3)
data = Table[Exp[-(x ^ 2 + y ^ 2 + z ^ 2)], {z, -1, 1, 1 / 20}, {y, -1, 1, 1 / 20}, {x, -1, 1, 1 / 20}];ListDensityPlot3D[data, DataRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]data = Table[Exp[-(x ^ 2 + y ^ 2 + z ^ 2)], {z, -1, 1, 1 / 20}, {y, -1, 1, 1 / 20}, {x, -1, 1, 1 / 20}];ListDensityPlot3D[data, DataRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, PlotRange -> {{-1, 0}, All, All}, BoxRatios -> Automatic]data = Table[Exp[-(x ^ 2 + y ^ 2 + z ^ 2)], {z, -1, 1, 0.05}, {y, -1, 1, 0.05}, {x, -1, 1, 0.05}];ListDensityPlot3D[data, PlotRange -> {All, All, All, {0, 0.2}}]ListDensityPlot3D[data, PlotRange -> {0, 0.2}]PlotTheme (3)
data = Table[x y z, {z, -1, 1, 2 / 40.}, {y, -1, 1, 2 / 40.}, {x, -1, 1, 2 / 40.}];ListDensityPlot3D[data, PlotTheme -> "Detailed"]data = Table[x y z, {z, -1, 1, 2 / 40.}, {y, -1, 1, 2 / 40.}, {x, -1, 1, 2 / 40.}];ListDensityPlot3D[data, PlotTheme -> "Detailed", FaceGrids -> None]data = Table[x y z, {z, -1, 1, 2 / 40.}, {y, -1, 1, 2 / 40.}, {x, -1, 1, 2 / 40.}];Table[ListDensityPlot3D[data, PlotLabel -> t, PlotTheme -> t, ImageSize -> 130], {t, {"Scientific", "Monochrome", "Minimal", "Web", "Working", "Classic", "Business", "Marketing", "Detailed"}}]RegionFunction (3)
data = Table[x y z, {z, -1, 1, 2 / 40.}, {y, -1, 1, 2 / 40.}, {x, -1, 1, 2 / 40.}];ListDensityPlot3D[data, RegionFunction -> Function[{x, y, z}, x ^ 2 + y ^ 2 + z ^ 2 ≤ 1], DataRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]data = Table[x ^ 2 + y ^ 2 - z ^ 2, {z, -2, 2, .2}, {y, -2, 2, .2}, {x, -2, 2, .2}];ListDensityPlot3D[data, RegionFunction -> Function[{x, y, z, f}, f < 2], DataRange -> {{-2, 2}, {-2, 2}, {-2, 2}}]data = Table[x ^ 2 + y ^ 2 - z ^ 2, {z, -2, 2, .2}, {y, -2, 2, .2}, {x, -2, 2, .2}];ListDensityPlot3D[data, RegionFunction -> Function[{x, y, z, f}, x < -1 || x > 1], DataRange -> {{-2, 2}, {-2, 2}, {-2, 2}}]ScalingFunctions (4)
ListDensityPlot3D[Table[Cos[x + y + z] / 10, {z, 0, 10, .25}, {y, 0, 10, .25}, {x, 0, 10, .25}]]ListDensityPlot3D[Table[Cos[x + y + z] / 10, {z, 0, 10, .25}, {y, 0, 10, .25}, {x, 0, 10, .25}], ScalingFunctions -> {"Log", None, None}]用 ScalingFunctions 反转
轴坐标的方向:
ListDensityPlot3D[Table[Cos[x + y + z] / 10, {z, 0, 10, .25}, {y, 0, 10, .25}, {x, 0, 10, .25}], ScalingFunctions -> {None, None, "Reverse"}]ListDensityPlot3D[Table[Cos[x + y + z] / 10, {z, 0, 10, .25}, {y, 0, 10, .25}, {x, 0, 10, .25}], ScalingFunctions -> {None, None, {-Log[#]&, Exp[-#]&}}]TargetUnits (1)
data = QuantityArray[Table[Exp[-(x ^ 2 + y ^ 2 + z ^ 2)], {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}], "Feet"];ListDensityPlot3D[data, TargetUnits -> {"Meters", "Meters", "Meters", "Meters"}, PlotLegends -> Automatic, AxesLabel -> Automatic]应用 (13)
初等函数 (4)
data = Table[x, {z, -2, 2}, {y, -2, 2}, {x, -2, 2, 0.25}];ListDensityPlot3D[data]{ListDensityPlot3D[Table[y, {z, -2, 2}, {y, -2, 2, 0.25}, {x, -2, 2}]],
ListDensityPlot3D[Table[z, {z, -2, 2, 0.25}, {y, -2, 2}, {x, -2, 2}]]}{ListDensityPlot3D[Table[x + y, {z, -2, 2}, {y, -2, 2, 0.25}, {x, -2, 2, 0.25}]],
ListDensityPlot3D[Table[y + z, {z, -2, 2, 0.25}, {y, -2, 2, 0.25}, {x, -2, 2}]]}{ListDensityPlot3D[Table[x + y + z, {z, -2, 2, 0.25}, {y, -2, 2, 0.25}, {x, -2, 2, 0.25}]],
ListDensityPlot3D[Table[x - y + z, {x, -2, 2, 0.2}, {y, -2, 2, 0.2}, {z, -2, 2, 0.2}]]}{ListDensityPlot3D[Table[x ^ 2 + y ^ 2, {z, -2, 2}, {y, -2, 2, 0.25}, {x, -2, 2, 0.25}]], ListDensityPlot3D[Table[y ^ 2 + z ^ 2, {z, -2, 2, 0.25}, {y, -2, 2, 0.25}, {x, -2, 2}]]}{ListDensityPlot3D[Table[x ^ 2 + y ^ 2 + z ^ 2, {z, -2, 2, 0.2}, {y, -2, 2, 0.2}, {x, -2, 2, 0.2}]], ListDensityPlot3D[Table[x ^ 2 + y ^ 2 + 2z ^ 2, {z, -2, 2, 0.2}, {y, -2, 2, 0.2}, {x, -2, 2, 0.2}]]}ListDensityPlot3D[Table[Sin[π x]Sin[π y]Sin[π z], {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}]]{ListDensityPlot3D[Table[Sin[π x]Sin[π (y + z)], {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}]], ListDensityPlot3D[Table[Sin[π (x + y)]Sin[π z], {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}]]}ListDensityPlot3D[Table[Sin[π (x + y + z)], {z, -2, 2, 0.1}, {y, -2, 2, 0.1}, {x, -2, 2, 0.1}]]f = Exp[-Norm[{x, y, z} - {-1, -1, -1}]^2] + Exp[-Norm[{x, y, z} - {1, 1, 1}]^2];ListDensityPlot3D[Table[f, {z, -2, 2, 0.2}, {y, -2, 2, 0.2}, {x, -2, 2, 0.2}]]f = Sum[Exp[-2Norm[{x, y, z} - pi]^2], {pi, RandomPoint[Cuboid[{-1, -1, -1}, {1, 1, 1}], 10]}];ListDensityPlot3D[Table[f, {x, -2, 2, 0.2}, {y, -2, 2, 0.2}, {z, -2, 2, 0.2}]]模拟数据 (6)
𝒟 = ProductDistribution[{LogNormalDistribution[0, 1], 3}];
f = PDF[𝒟, {x, y, z}]ListDensityPlot3D[Table[f, {z, 0, 3, .1}, {y, 0, 3, .1}, {x, 0, 3, .1}], DataRange -> {{0, 3}, {0, 3}, {0, 3}}]data = Last@HistogramList[RandomVariate[𝒟, 10 ^ 6], {0, 3, 0.1}];ListDensityPlot3D[data]walk = Accumulate[RandomInteger[{-1, 1}, {10 ^ 5, 3}]];Graphics3D[Line[walk], BoxRatios -> 1, Axes -> True]data = Last@HistogramList[walk];ListDensityPlot3D[data, PlotLegends -> Automatic, DataRange -> CoordinateBounds[walk]]data = CellularAutomaton[{2274, {2, 1}, {1, 1, 1}}, {{{{1}}}, 0}, {20, {{10}}}];ListDensityPlot3D[data]data = Last@SubstitutionSystem[{1 -> 1 - CrossMatrix[{1, 1, 1}], 0 -> ConstantArray[0, {3, 3, 3}]}, {{{1}}}, 3];ListDensityPlot3D[data, OpacityFunction -> (#&), ColorFunction -> GrayLevel]data = Last@SubstitutionSystem[{1 -> ArrayReshape[IntegerDigits[45115427, 2, 27], {3, 3, 3}], 0 -> ConstantArray[0, {3, 3, 3}]}, {{{1}}}, 3];ListDensityPlot3D[data]通过对数组中半径为1的范围取均值,模拟一个二维随机值数组的离散扩散模型:
g[d_] := ArrayFilter[Total[#, 2] / 9&, d, 1];ListDensityPlot3D[NestList[g, RandomReal[1, {40, 40}], 40], PlotLegends -> Automatic, AxesLabel -> {None, None, "time"}]数据模式 (3)
data = Arg[Fourier[Table[1 / LCM[i, j, k], {i, 64}, {j, 64}, {k, 64}]]];ListDensityPlot3D[data]positions = ProteinData["RAB21", "AtomPositions"];data = Last@HistogramList[positions];ListDensityPlot3D[data, PlotLegends -> Automatic]ProteinData["RAB21", "MoleculePlot"]data = ExampleData[{"TestImage3D", "MRbrain"}, "GrayLevels"];ListDensityPlot3D[data, BoxRatios -> Automatic]如果想得到与 Image3D 定位一致的图像,使用选项 DataReversed:
data = ImageData[ExampleData[{"TestImage3D", "MRbrain"}, "Image3D"], DataReversed -> True];ListDensityPlot3D[data, BoxRatios -> Automatic]属性和关系 (6)
用 ListSliceDensityPlot3D 绘制切片曲面的密度图:
data = Table[x y z, {z, -2, 2, .1}, {y, -2, 2, .1}, {x, -2, 2, .1}];{ListSliceDensityPlot3D[data, "BackPlanes"], ListDensityPlot3D[data]}用 ListDensityPlot 绘制二维密度图:
data = Table[x ^ 2 + y ^ 2, {z, -1, 1, .1}, {y, -1, 1, .1}, {x, -1, 1, .1}];{ListDensityPlot[First[data]], ListDensityPlot3D[data, OpacityFunction -> None]}用 DensityPlot3D 绘制函数:
data = Table[x y z, {z, -1, 1, 0.05}, {y, -1, 1, 0.05}, {x, -1, 1, 0.05}];{DensityPlot3D[x y z, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}], ListDensityPlot3D[data]}用 ListSliceContourPlot3D 绘制切片曲面的等高线图:
data = Table[x ^ 2 + y ^ 2 + z ^ 2, {z, -2, 2, .1}, {y, -2, 2, .1}, {x, -2, 2, .1}];{ListSliceContourPlot3D[data], ListDensityPlot3D[data]}用 ListContourPlot3D 绘制常数值曲面:
data = Table[x ^ 2 + y ^ 2 + z ^ 2, {z, -2, 2, .1}, {y, -2, 2, .1}, {x, -2, 2, .1}];{ListContourPlot3D[data], ListDensityPlot3D[data]}用 ArrayPlot3D 绘制离散数据:
data = Table[GCD[x, y, z] - 1, {z, -5, 5}, {y, -5, 5}, {x, -5, 5}];{ArrayPlot3D[data], ListDensityPlot3D[data]}文本
Wolfram Research (2015),ListDensityPlot3D,Wolfram 语言函数,https://reference.wolfram.com/language/ref/ListDensityPlot3D.html (更新于 2025 年).
CMS
Wolfram 语言. 2015. "ListDensityPlot3D." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2025. https://reference.wolfram.com/language/ref/ListDensityPlot3D.html.
APA
Wolfram 语言. (2015). ListDensityPlot3D. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/ListDensityPlot3D.html 年
BibTeX
@misc{reference.wolfram_2026_listdensityplot3d, author="Wolfram Research", title="{ListDensityPlot3D}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ListDensityPlot3D.html}", note=[Accessed: 02-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_listdensityplot3d, organization={Wolfram Research}, title={ListDensityPlot3D}, year={2025}, url={https://reference.wolfram.com/language/ref/ListDensityPlot3D.html}, note=[Accessed: 02-November-2026]}