DensityPlot3D [f,{x,xmin,xmax},{y,ymin,ymax},{z,zmin,zmax}]
makes a density plot of f as a function of x, y, and z.
DensityPlot3D [f,{x,y,z}∈reg]
takes the variables to be in the geometric region reg.
DensityPlot3D
DensityPlot3D [f,{x,xmin,xmax},{y,ymin,ymax},{z,zmin,zmax}]
makes a density plot of f as a function of x, y, and z.
DensityPlot3D [f,{x,y,z}∈reg]
takes the variables to be in the geometric region reg.
Details and Options
- DensityPlot3D is also known as volume map.
- DensityPlot3D evaluates the function over its domain and maps the value to a color and opacity independently.
- The opacity function is typically used to make some range of values visible, while making some others invisible.
- The plot visualizes the set , where is a color function and is an opacity function.
- At positions where f does not evaluate to a real number, data is taken to be missing and is rendered transparently.
- DensityPlot3D treats the variables x, y, and z as local, effectively using Block .
- DensityPlot3D has attribute HoldAll , and evaluates f only after assigning specific numerical values to x, y, and z.
- In some cases it may be more efficient to use Evaluate to evaluate f symbolically before specific numerical values are assigned to x, y, and z.
- DensityPlot3D has the same options as Graphics3D , with the following additions and changes: [List of all options]
-
- ColorFunction and OpacityFunction are supplied with a single argument, given by default by the scaled value of f.
- Typical settings for OpacityFunction include:
-
Automatic automatically determinedNone no opacity function, fully opaqueα constant opacity Opacity [α]"Image3D" default opacity function used in Image3Dfunc general opacity function
- The arguments supplied to RegionFunction are x, y, z, and f.
- Possible settings for ScalingFunctions include:
-
sf scale the fcontour values{sx,sy,sz} scale x, y and z axes{sx,sy,sz,sf} scale x, y and z axes and fcontour values
- Common built-in scaling functions s include:
-
"Log" log scale with automatic tick labeling"Log10" base-10 log scale with powers of 10 for ticks"SignedLog" log-like scale that includes 0 and negative numbers"Reverse" reverse the coordinate direction"Infinite" infinite scale
-
ImageMargins 0. the margins to leave around the graphicPreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphicRotationAction "Fit" how to render after interactive rotation
List of all options
Examples
open all close allBasic Examples (3)
Plot a 3D function:
Plot a function over a ball:
Use a different color scheme and legend:
Scope (13)
Sampling (6)
Areas where the function becomes nonreal are excluded:
Use PlotPoints to control sampling:
The domain may be specified by a region including Cone :
A formula region including ImplicitRegion :
A mesh-based region including BoundaryMeshRegion :
Use PlotRange to limit ranges to expose more detail:
Use ClipPlanes to specify one or several clipping planes. In this case, clip :
Use RegionFunction to constrain point inclusion more generally:
Presentation (7)
Use PlotTheme to immediately get overall styling:
Use PlotLegends to get a color bar for the different values:
Control the display of axes with Axes :
Label axes using AxesLabel and the whole plot using PlotLabel :
Color the plot by the function values with ColorFunction :
TargetUnits specifies which units to use in the visualization:
Use a log scale for the axis:
Reverse the axis so that values increase as they go down:
Options (69)
Axes (4)
By default, axes are drawn for DensityPlot3D :
Use Axes False to turn off axes:
Use AxesOrigin to specify where the axes intersect:
Turn each axis on individually:
AxesLabel (4)
No axes labels are drawn by default:
Place a label on the axis:
Specify axes labels:
Use labels based on variables specified in DensityPlot3D :
AxesOrigin (2)
The position of the axes is determined automatically:
Specify an explicit origin for the axes:
AxesStyle (4)
Change the style for the axes:
Specify the style of each axis:
Use different styles for the ticks and the axes:
Use different styles for the labels and the axes:
BoxRatios (2)
ClipPlanes (3)
Use ClipPlanes to specify one or several clipping planes. In this case, clip :
Specify several clip planes, in this case clipping and :
Compare to the general RegionFunction :
ColorFunction (1)
Color the function according to the x, y, z, or f values:
ColorFunctionScaling (2)
Parameters to ColorFunction are normally scaled to be between 0 and 1:
Use unscaled density values by setting ColorFunctionScaling to False :
ImageSize (7)
Use named sizes such as Tiny , Small , Medium and Large :
Specify the width of the plot:
Specify the height of the plot:
Allow the width and height to be up to a certain size:
Specify the width and height for a graphic, padding with space if necessary:
Setting AspectRatio Full will fill the available space:
Use maximum sizes for the width and height:
Use ImageSize Full to fill the available space in an object:
Specify the image size as a fraction of the available space:
OpacityFunction (6)
OpacityFunction is Automatic by default:
Turn off transparency with OpacityFunction None :
Make values in the intervals and more opaque:
Use a constant opacity Opacity [0.05]:
Use the same opacity function as the one used in Image3D :
Use a custom opacity function to specify the opacity for each density value:
OpacityFunctionScaling (3)
By default, scaled values are used:
Use unscaled density values by setting OpacityFunctionScaling to False :
Specify an unscaled opacity interval:
PerformanceGoal (2)
Generate a higher-quality plot:
Emphasize performance, possibly at the cost of quality:
PlotLegends (2)
No legends are used by default:
Use PlotLegends->Automatic to show a legended plot:
PlotPoints (2)
Use more points to get a smoother density:
Use 2 points in the direction, 4 in the direction, and 8 in the direction:
PlotRange (3)
Show the density plot over the full , , range:
Use specific ranges to show more detail:
Show only function values between 0 and 1:
Equivalently, the full specification:
PlotTheme (3)
Use a plot theme:
Option settings override theme settings, in this case removing face grids:
Compare different plot themes:
RegionFunction (3)
Plot over a ball in , , and :
Show only areas where :
Regions do not have to be connected:
ScalingFunctions (4)
By default, DensityPlot3D has linear scales in all directions:
Create a plot with a log-scaled axis:
Use ScalingFunctions to reverse the coordinate direction in the direction:
Use an scale defined by a function, specifying the function and its inverse:
TargetUnits (2)
Axes and legends are labeled with the units specified by TargetUnits :
Units specified by Quantity are converted to those specified by TargetUnits :
Ticks (6)
Ticks are placed automatically in each plot:
Use Ticks None to not draw any tick marks:
Place tick marks at specific positions:
Draw tick marks at the specified positions with the specified labels:
Specify tick marks with scaled lengths:
Customize each tick with position, length, labeling and styling:
TicksStyle (3)
By default, the ticks and tick labels use the same styles as the axis:
Specify overall ticks style, including the tick labels:
Specify tick style for each of the axes:
WorkingPrecision (1)
Evaluate functions using machine-precision arithmetic:
Applications (17)
Elementary Functions (4)
Plot the function :
Plot the functions and :
Plot the functions and :
Plot the functions and :
Plot the functions and :
Plot the functions and :
Plot , a product of univariate functions:
Plot and , univariate and bivariate functions:
Plot , a trivariate function:
Plot a sum of exponentials sum_ialpha_i exp(-TemplateBox[{{p, -, {p, _, i}}}, Norm]^2):
Pick the points randomly in a box:
Distribution Functions (6)
Plot the PDF of a distribution:
Simulate the distribution and show point distribution:
Plot the CDF of a distribution:
The SurvivalFunction :
The HazardFunction :
Explore Correlation parameters for a MultinormalDistribution , where ρab is the correlation between a and b:
Correlation between x and y only:
Correlation between y and z only:
Correlation between y and z only, but larger variance in the z component:
Visualize the PDF of a ProductDistribution :
A product of three different distributions:
A product of bivariate and univariate distributions:
Plot the PDF of a CopulaDistribution :
Visualize the PDF of a kernel density estimate of some trivariate data:
Use ClipPlanes to see through the middle:
Partial Differential Equations (3)
Visualize a nonlinear sine-Gordon equation in two spatial dimensions with periodic boundary conditions, with time represented along the axis:
The solution evolves in time along the axis:
A cross-sectional view:
Visualize Wolfram's nonlinear wave equation in two spatial dimensions with time represented along the axis:
A cross-sectional view:
Visualize solutions to 3D partial differential equations. In this case, a Poisson equation over a Ball and Dirichlet boundary conditions:
Plot it:
Potential and Wave Functions (4)
Visualize a field of randomly placed charges:
Plot spherical waves cos(omega TemplateBox[{{p, -, {p, _, i}}}, Norm]) from three sources in space:
Plot an acoustic quadrupole:
Plot hydrogen orbital densities for quantum numbers , , :
Plot :
Properties & Relations (5)
Use ListDensityPlot3D for data:
Use DensityPlot for density plots in 2D:
Use SliceDensityPlot3D for density plots over slice surfaces:
Use SliceContourPlot3D for contour plots over slice surfaces:
Use ContourPlot3D for constant value surfaces:
Related Guides
Text
Wolfram Research (2015), DensityPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/DensityPlot3D.html (updated 2022).
CMS
Wolfram Language. 2015. "DensityPlot3D." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/DensityPlot3D.html.
APA
Wolfram Language. (2015). DensityPlot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DensityPlot3D.html
BibTeX
@misc{reference.wolfram_2025_densityplot3d, author="Wolfram Research", title="{DensityPlot3D}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/DensityPlot3D.html}", note=[Accessed: 05-December-2025]}
BibLaTeX
@online{reference.wolfram_2025_densityplot3d, organization={Wolfram Research}, title={DensityPlot3D}, year={2022}, url={https://reference.wolfram.com/language/ref/DensityPlot3D.html}, note=[Accessed: 05-December-2025]}