WOLFRAM

SliceDensityPlot3D[f,surf,{x,xmin,xmax},{y,ymin,ymax},{z,zmin,zmax}]

generates a density plot of f over the slice surface surf as a function of x, y, and z.

SliceDensityPlot3D[f,surf,{x,y,z}reg]

restricts the surface to be within region reg.

SliceDensityPlot3D[f,{surf1,surf2,},]

generates density plots over several slices.

Details and Options

Examples

open allclose all

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

Plot the density of on coordinate planes through the center of the plot range:

Out[1]=1

Plot the density on the surface :

Out[1]=1

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

Surfaces  (9)

Generate a density plot over standard slice surfaces:

Out[1]=1

Standard axis-aligned stacked slice surfaces:

Out[1]=1

Standard boundary surfaces:

Out[1]=1

Plot the densities over any surface region:

Out[1]=1

Plotting over a volume primitive is equivalent to plotting over RegionBoundary[reg]:

Out[1]=1

Plot the densities over the surface :

Out[1]=1

Plot the densities over multiple surfaces:

Out[1]=1

Specify the number of stack planes:

Out[1]=1

Specify the cutting angle for a center-cut sphere slice:

Out[1]=1

Sampling  (3)

Areas where the function becomes nonreal are excluded:

Out[1]=1

Use RegionFunction to expose obscured slices:

Out[1]=1

The domain may be specified by a region including Cone:

Out[1]=1

A formula region including ImplicitRegion:

Out[3]=3

A mesh-based region including BoundaryMeshRegion:

Out[4]=4
Out[5]=5

Presentation  (9)

Use PlotTheme to immediately get overall styling:

Out[1]=1

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

Out[1]=1

Control the display of axes with Axes:

Out[1]=1

Label axes using AxesLabel and the whole plot using PlotLabel:

Out[1]=1

Color the plot by the function values with ColorFunction:

Out[1]=1

Style the slice surface boundaries with BoundaryStyle:

Out[1]=1

TargetUnits specifies which units to use in the visualization:

Out[1]=1

Create a plot with a log-scaled axis:

Out[1]=1

Reverse the coordinate direction in the direction:

Out[1]=1

Options  (33)Common values & functionality for each option

BoundaryStyle  (1)

Style the slice surface boundaries:

Out[1]=1

BoxRatios  (3)

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

Out[1]=1

Use BoxRatios->Automatic to show the natural scale of the 3D coordinate values:

Out[1]=1

Use custom length ratios for each side of the bounding box:

Out[1]=1

ClippingStyle  (2)

Color clipped regions:

Out[1]=1

Remove clipped regions with None:

Out[1]=1

ColorFunction  (3)

Color the slice surfaces according to the density values :

Out[1]=1

Use a named color gradient available in ColorData:

Out[1]=1

Use red when :

Out[1]=1

ColorFunctionScaling  (2)

By default, scaled values are used:

Out[1]=1

Use ColorFunctionScaling->False to get access to unscaled f values:

Out[1]=1

PerformanceGoal  (2)

Generate a higher-quality plot:

Out[1]=1

Emphasize performance, possibly at the cost of quality:

Out[1]=1

PlotLegends  (3)

Show a legend for the densities:

Out[1]=1

PlotLegends automatically matches the color function:

Out[1]=1

Control placement of the legend with Placed:

Out[1]=1

PlotPoints  (1)

Use PlotPoints to determine sampling of slice surfaces:

Out[1]=1

PlotRange  (3)

Show All contours by default:

Out[1]=1

Show a select range:

Out[1]=1

Show only function values between 0 and 2:

Out[1]=1

Or with the fully qualified specification:

Out[2]=2

PlotTheme  (3)

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

Out[1]=1

Any option setting overrides PlotTheme settings, in this case removing face grids:

Out[1]=1

Compare different plot themes:

Out[1]=1

RegionFunction  (2)

Include only the contours where or :

Out[1]=1

Include only the contours where :

Out[1]=1

ScalingFunctions  (5)

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

Slice surfaces that are defined relative to the bounding box are unaffected by scaling functions:

Out[1]=1

TargetUnits  (2)

Axes and legends are labeled with the units specified by TargetUnits:

Out[1]=1

Units specified by Quantity are converted to those specified by TargetUnits:

Out[1]=1

WorkingPrecision  (1)

Evaluate functions using machine-precision arithmetic:

Out[1]=1

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

Elementary Functions  (4)

Plot the function :

Out[1]=1

Plot the functions and :

Out[2]=2

Plot the functions and :

Out[3]=3

Plot the functions and :

Out[4]=4

Plot the functions and :

Out[1]=1

Plot the functions and :

Out[2]=2

Plot , a product of univariate functions:

Out[2]=2

Plot and , univariate and bivariate functions:

Out[3]=3

Plot , a trivariate function:

Out[4]=4

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

Compare with other ways of visualizing:

Out[5]=5

Show them together:

Out[6]=6

Distribution Functions  (5)

Plot the PDF of a distribution:

Out[3]=3

Simulate the distribution and show point distribution:

Out[5]=5

Plot the CDF of a distribution:

Out[2]=2

The SurvivalFunction:

Out[4]=4

The HazardFunction:

Out[6]=6

Explore Correlation parameters for a MultinormalDistribution, where ρab is the correlation between a and b:

Correlation between x and y only:

Out[3]=3

Use planes given by the covariance matrix:

Out[4]=4
Out[5]=5

Visualize the PDF of a ProductDistribution:

Out[1]=1
Out[2]=2

A product of three different distributions:

Out[3]=3
Out[4]=4

Visualize the PDF of a kernel density estimate of some trivariate data, where density > 0.01:

Out[2]=2

Potential and Wave Functions  (4)

Plot the phase using color on the isosurface of a quadrupole potential:

Out[2]=2

Alternatively, show the 17<=TemplateBox[{f}, Abs]<=140 on several planes:

Out[3]=3

Plot spherical waves cos(omega TemplateBox[{{p, -, {p, _, i}}}, Norm]) from three sources in space:

Out[1]=1
Out[2]=2

Plot hydrogen orbital densities for quantum numbers , , :

Out[1]=1

Plot on a surface:

Out[3]=3

Plot :

Out[4]=4

An electrostatic potential built from a collection of point charges at positions :

Two charges and :

Out[3]=3

Plot iso charge surfaces:

Out[4]=4

Show them together:

Out[5]=5

Partial Differential Equations  (3)

Visualize a nonlinear sine-Gordon equation in two spatial dimensions with periodic boundary conditions, with time represented along the axis:

Out[2]=2

The solution evolves in time along the axis:

Out[3]=3

Visualize Wolfram's nonlinear wave equation in two spatial dimensions, with time represented along the axis:

Out[1]=1
Out[2]=2

Visualize solutions to 3D partial differential equations. In this case, a Poisson equation over a Ball and Dirichlet boundary conditions:

Out[1]=1
Out[2]=2

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

Use SliceContourPlot3D for contours on surfaces:

Out[1]=1

Use ContourPlot3D for constant value surfaces:

Out[1]=1

Use DensityPlot3D for full volume visualization of the function values:

Out[1]=1

Use ListSliceDensityPlot3D for data:

Out[2]=2

Use DensityPlot for density plots in 2D:

Out[1]=1

Possible Issues  (1)Common pitfalls and unexpected behavior

Slice surfaces with a constant value may appear noisy:

Out[1]=1

The function is constant on the chosen slice surface:

Out[2]=2

Choosing a different slice surface gives a reasonable picture of the function:

Out[3]=3
Wolfram Research (2015), SliceDensityPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/SliceDensityPlot3D.html (updated 2022).
Wolfram Research (2015), SliceDensityPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/SliceDensityPlot3D.html (updated 2022).

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2025_slicedensityplot3d, author="Wolfram Research", title="{SliceDensityPlot3D}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/SliceDensityPlot3D.html}", note=[Accessed: 09-July-2025 ]}

@misc{reference.wolfram_2025_slicedensityplot3d, author="Wolfram Research", title="{SliceDensityPlot3D}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/SliceDensityPlot3D.html}", note=[Accessed: 09-July-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_slicedensityplot3d, organization={Wolfram Research}, title={SliceDensityPlot3D}, year={2022}, url={https://reference.wolfram.com/language/ref/SliceDensityPlot3D.html}, note=[Accessed: 09-July-2025 ]}

@online{reference.wolfram_2025_slicedensityplot3d, organization={Wolfram Research}, title={SliceDensityPlot3D}, year={2022}, url={https://reference.wolfram.com/language/ref/SliceDensityPlot3D.html}, note=[Accessed: 09-July-2025 ]}