WOLFRAM

generates a smooth density plot from an array of values farr.

ListDensityPlot3D[{{x1,y1,z1,f1},,{xn,yn,zn,fn}}]

generates a density plot with values fi at the specified points {xi,yi,zi}.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Plot the density for an array of values:

Out[2]=2

Use a different color scheme and legend:

Out[2]=2

Scope  (16)Survey of the scope of standard use cases

Data  (7)

For regular data consisting of values, the , , and data reflects its positions in the array:

Out[2]=2

Provide explicit , , and data ranges by using DataRange:

Out[3]=3

Give explicit , , , coordinates for points in a density:

Out[2]=2

For irregular data , the , , and data ranges are inferred from data:

Out[2]=2

Use RegionFunction to constrain data inclusion more generally:

Out[2]=2

Plot the density for an array of values given by SparseArray:

Out[2]=2

Plot the density for an array of values given by QuantityArray:

Out[2]=2

Use ClipPlanes to specify one or several clipping planes. In this case, clip :

Out[2]=2

Tabular Data  (1)

Get tabular data:

Out[2]=2

Plot tabular data in which each column represents data in the form {x,y,z,f}:

Out[3]=3

Include a legend for the plot:

Out[4]=4

Presentation  (8)

Use PlotTheme to immediately get overall styling:

Out[2]=2

Use PlotLegends to get a color bar for the different values:

Out[2]=2

Control the display of axes with Axes:

Out[2]=2

Label axes using AxesLabel and the whole plot using PlotLabel:

Out[2]=2

Color the plot by the function values with ColorFunction:

Out[2]=2

Use a custom opacity function to specify the opacity for each point volume:

Out[2]=2

TargetUnits specifies which units to use in the visualization:

Out[2]=2

Use ScalingFunctions in the x direction:

Out[1]=1

Options  (38)Common values & functionality for each option

BoxRatios  (3)

By default, the edges of the bounding box have the same length:

Out[2]=2

Use BoxRatiosAutomatic to show the natural scale of the 3D coordinate values:

Out[2]=2

Specify the ratios between the bounding box lengths:

Out[2]=2

ClipPlanes  (3)

Use ClipPlanes to specify a clipping plane. In this case, clip :

Out[2]=2

Specify several clip planes, in this case clipping and :

Out[2]=2

Compare to the general RegionFunction:

Out[2]=2

ColorFunction  (2)

Color by scaled f value at x, y, z coordinates:

Out[2]=2

Use color functions from ColorData:

Out[2]=2

ColorFunctionScaling  (2)

Parameters to ColorFunction are normally scaled to be between 0 and 1:

Out[1]=1

Use unscaled coordinates by setting ColorFunctionScaling to False:

Out[2]=2

DataRange  (2)

By default, the data range is taken to be the dimension of the array:

Out[2]=2

Explicitly specify the data range:

Out[2]=2

MaxPlotPoints  (1)

Specify the maximum number of data points:

By default, use all the data:

Out[2]=2

OpacityFunction  (5)

OpacityFunction is Automatic by default:

Out[2]=2

Use None to make the whole volume opaque:

Out[2]=2

Use a custom opacity function to specify the opacity for each point volume:

Out[2]=2

Make values in the intervals and more opaque:

Out[2]=2

Use a constant opacity Opacity[0.05]:

Out[2]=2

OpacityFunctionScaling  (2)

By default, scaled values are used:

Out[2]=2

Use unscaled density values by setting OpacityFunctionScaling to False:

Out[2]=2

PerformanceGoal  (2)

Generate a higher-quality plot:

Out[2]=2

Emphasize performance, possibly at the cost of quality:

Out[2]=2

PlotLegends  (2)

No legends are used by default:

Out[2]=2

Use PlotLegends->Automatic to show a legended plot:

Out[2]=2

PlotRange  (3)

By default, the full plot range is shown:

Out[2]=2

Use specific ranges to show more detail:

Out[2]=2

Show only function values between 0 and 0.2:

Out[2]=2

Alternatively:

Out[3]=3

PlotTheme  (3)

Use a theme with detailed grid lines, ticks, and legends:

Out[2]=2

Turn off the grid lines:

Out[2]=2

Compare different plot themes:

Out[2]=2

RegionFunction  (3)

Plot over a ball in , , and :

Out[2]=2

Show only areas where :

Out[2]=2

Regions do not have to be connected:

Out[2]=2

ScalingFunctions  (4)

By default, plots have linear scales in all directions:

Out[1]=1

Create a plot with a log-scaled axis:

Out[1]=1

Use ScalingFunctions to scale to reverse the coordinate direction in the direction:

Out[1]=1

Use a scale defined by a function and its inverse:

Out[1]=1

TargetUnits  (1)

Specify which units to use in the visualization:

Out[2]=2

Applications  (13)Sample problems that can be solved with this function

Elementary Functions  (4)

Plot the function :

Out[2]=2

Plot the functions and :

Out[3]=3

Plot the functions and :

Out[4]=4

Plot the functions and :

Out[5]=5

Plot the functions and :

Out[1]=1

Plot the functions and :

Out[2]=2

Plot , a product of univariate functions:

Out[1]=1

Plot and , univariate and bivariate functions:

Out[2]=2

Plot , a trivariate function:

Out[3]=3

Plot a sum of exponentials sum_ialpha_i exp(-TemplateBox[{{p, -, {p, _, i}}}, Norm]^2):

Out[2]=2

Pick the points randomly in a box:

Out[4]=4

Simulation Data  (6)

Plot a probability density function of three variables:

Out[2]=2
Out[3]=3

Simulate the distribution and compute the bin counts:

Out[5]=5

Simulate a random walk and show the path:

Out[2]=2

Bin the position that the walk hits in space and show the density:

Out[4]=4

Plot the evolution of two-dimensional cellular automata:

Out[2]=2

Generate a Menger sponge array:

Out[2]=2

Plot the evolution of a substitution system:

Out[2]=2

Simulate a discrete diffusion model of a two-dimensional array of random values by averaging values of a radius-1 neighborhood in the array:

Out[2]=2

Data Patterns  (3)

Visualize the phase for a 3D discrete Fourier transform on data:

Out[2]=2

Bin the position of atoms in a protein and show the density:

Out[3]=3

Compare with the molecule plot:

Out[4]=4

Visualize MRI data from a brain:

Out[2]=2

To get the same orientation used by Image3D, use the option DataReversed:

Out[4]=4

Properties & Relations  (6)Properties of the function, and connections to other functions

Use ListSliceDensityPlot3D for density plots over slice surfaces:

Out[2]=2

Use ListDensityPlot for density plots in 2D:

Out[2]=2

Use DensityPlot3D for functions:

Out[2]=2

Use ListSliceContourPlot3D for contours over slice surfaces:

Out[2]=2

Use ListContourPlot3D for constant value surfaces:

Out[2]=2

Use ArrayPlot3D for discrete data:

Out[2]=2
Wolfram Research (2015), ListDensityPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ListDensityPlot3D.html (updated 2025).
Wolfram Research (2015), ListDensityPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ListDensityPlot3D.html (updated 2025).

Text

Wolfram Research (2015), ListDensityPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ListDensityPlot3D.html (updated 2025).

Wolfram Research (2015), ListDensityPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ListDensityPlot3D.html (updated 2025).

CMS

Wolfram Language. 2015. "ListDensityPlot3D." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/ListDensityPlot3D.html.

Wolfram Language. 2015. "ListDensityPlot3D." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/ListDensityPlot3D.html.

APA

Wolfram Language. (2015). ListDensityPlot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ListDensityPlot3D.html

Wolfram Language. (2015). ListDensityPlot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ListDensityPlot3D.html

BibTeX

@misc{reference.wolfram_2025_listdensityplot3d, author="Wolfram Research", title="{ListDensityPlot3D}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ListDensityPlot3D.html}", note=[Accessed: 21-April-2025 ]}

@misc{reference.wolfram_2025_listdensityplot3d, author="Wolfram Research", title="{ListDensityPlot3D}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ListDensityPlot3D.html}", note=[Accessed: 21-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_listdensityplot3d, organization={Wolfram Research}, title={ListDensityPlot3D}, year={2025}, url={https://reference.wolfram.com/language/ref/ListDensityPlot3D.html}, note=[Accessed: 21-April-2025 ]}

@online{reference.wolfram_2025_listdensityplot3d, organization={Wolfram Research}, title={ListDensityPlot3D}, year={2025}, url={https://reference.wolfram.com/language/ref/ListDensityPlot3D.html}, note=[Accessed: 21-April-2025 ]}