Volume Visualization

Brett Champion
Wolfram

Join the Conversation #WolframTechConf

Volume Visualization

Volume Plots

RegionPlot3D[x^2+y^2≤z^2,{x,-2,2},{y,-2,2},{z,-2,2}]

Contour Plots

ContourPlot3D[x^2+y^2==z^2,{x,-2,2},{y,-2,2},{z,-2,2}]

ContourPlot3D[x^2+y^2-z^2,{x,-2,2},{y,-2,2},{z,-2,2}]

Volume Visualization

Density Plots

DensityPlot3D[Sin[x]Sin[y]Sin[z],{x,-π,π},{y,-π,π},{z,-π,π},PlotLegends->Automatic]

Density Plot over a Region

DensityPlot3D[Sin[x]Sin[y]Sin[z],{x,y,z}∈Ball[{0,0,0},π],PlotLegends->Automatic]

OpacityFunction

DensityPlot3D[Sin[x]Sin[y]Sin[z],{x,y,z}∈Ball[{0,0,0},π],PlotLegends->Automatic,OpacityFunction->Interval[{-1,-0.25},{0.25,1}],OpacityFunctionScaling->False]

Volume Visualization

Slice Density Plots

SliceDensityPlot3D[x^2+y^2+z^2,{x,-2,2},{y,-2,2},{z,-2,2},PlotLegends->Automatic]

Slice Contour Plots

SliceContourPlot3D[x^2+y^2+z^2,{x,-2,2},{y,-2,2},{z,-2,2},PlotLegends->Automatic]

Slice Vector Plots

SliceVectorPlot3D[{y-z,-x+z,x-y},{x,-2,2},{y,-2,2},{z,-2,2}]

Volume Visualization

Predefined Slices

SliceDensityPlot3D[x^2+y^2-z^2,#,{x,-2,2},{y,-2,2},{z,-2,2},ImageSize->Medium]&/@{"BackPlanes","CenterCutSphere","CenterCutBox"}

Stacked Slices

SliceContourPlot3D[x^2+y^2-z^2,{#,5},{x,-2,2},{y,-2,2},{z,-2,2},ImageSize->Medium]&/@{"XStackedPlanes","ZStackedPlanes","DiagonalStackedPlanes"}

Equational Slices

SliceContourPlot3D[x^2+y^2-z^2,x^2Sin[y]+y^2Sin[z]+z^2Sin[x]==0,{x,-2,2},{y,-2,2},{z,-2,2}]

Mesh Slices

SliceVectorPlot3D[{x,y,z},ConvexHullMesh[RandomReal[{-1,1},{30,3}]],{x,-1,1},{y,-1,1},{z,-1,1}]

Volume Visualization

Plot hydrogen orbital densities for quantum numbers n, m, l:

a0=Quantity["BohrRadius"]/Quantity["Meters"]

ψ[{n_,l_,m_},{r_,θ_,ϕ_}]:=With[{ρ=2r/(n a0)},(Sqrt[((((2/(n a0))))^3)(((n-l-1)!)/(2n(n+l)!))])Exp[-ρ/2](ρ^l)LaguerreL[n-l-1,2l+1,ρ]SphericalHarmonicY[l,m,θ,ϕ]]

Plot (Subscript[ψ, 2,1,0])(r,θ,ϕ) on a surface:

SliceDensityPlot3D[(((Abs@ψ[{2,1,0},{(Sqrt[(x^2)+(y^2)+(z^2)]),ArcTan[z,(Sqrt[(x^2)+(y^2)])],ArcTan[x,y]}]))^2),"CenterCutSphere",{x,-5 a0,5 a0},{y,-5 a0,5 a0},{z,-5 a0,5 a0},PlotLegends->Automatic]

Plot (Subscript[ψ, n,m,l])(r,θ,ϕ):

Grid@(Flatten/@Table[SliceDensityPlot3D[(((Abs@ψ[{n,l,m},{(Sqrt[(x^2)+(y^2)+(z^2)]),ArcTan[z,(Sqrt[(x^2)+(y^2)])],ArcTan[x,y]}]))^2),"CenterCutSphere",{x,-5 a0,5 a0},{y,-5 a0,5 a0},{z,-5 a0,5 a0},PlotLabel->{n,l,m},PlotTheme->"NoAxis",ImageSize->120],{n,1,3},{l,0,n-1},{m,-l,l}])