ContourPlot3D

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

produces a three-dimensional contour plot of f as a function of x, y, and z.

ContourPlot3D[f==g,{x,xmin,xmax},{y,ymin,ymax},{z,zmin,zmax}]

plots the contour surface for which .

ContourPlot3D[,{x,y,z}reg]

takes the variables {x,y,z} to be in the geometric region reg.

Details and Options

Examples

open allclose all

Basic Examples  (4)

Plot a 3D contour surface:

Plot several contour surfaces:

Plot contours over a ball with radius three:

Use styling to emphasize features:

Scope  (16)

Sampling  (6)

Plot over a geometric region:

Plot over an implicitly defined region:

More points are sampled where the function changes quickly:

Areas where the function becomes nonreal are excluded:

Use PlotPoints and MaxRecursion to control adaptive sampling:

Use RegionFunction to show interior features:

Presentation  (10)

Add labels:

Color the surface by height:

Apply styles to a contour:

Show multiple implicit surfaces with explicit styles:

Use transparency to show interior features:

Use an overlay mesh:

Fill with different colors between mesh lines:

Legend styles with contour values automatically:

Legend contours with expressions:

Use a theme with dark background in a high-contrast color scheme:

Reverse the scale on the axis:

Options  (74)

BoundaryStyle  (3)

Use a red boundary around the edges of the contours:

Use None to omit the boundary:

BoundaryStyle applies to holes cut by RegionFunction:

BoxRatios  (1)

Use Automatic to show the natural scale of the surface:

ColorFunction  (5)

Color the contours according to the , , , or values:

Use a named color gradient:

ColorFunction has higher priority than ContourStyle:

Use red when :

ColorFunction has lower priority than MeshShading:

ColorFunctionScaling  (2)

Use unscaled values to color the contours:

Use an overlay density based on the coordinate values:

Contours  (4)

Use 5 equally spaced contours:

Use automatic contour selection:

Use specific contours:

Use specific contours with specific styles:

ContourStyle  (8)

Use transparent contours:

Use distinct colors for each contour:

Use FaceForm to get different colors on the inside and outside:

Alternate styles for contour surfaces:

Use the same style for all the equations:

Use different styles for different equations:

ColorFunction has higher priority than ContourStyle:

MeshShading has higher priority than ContourStyle:

EvaluationMonitor  (2)

Show where ContourPlot3D samples a function:

Count how many times is evaluated:

MaxRecursion  (1)

Refine the contour where it changes quickly:

Mesh  (6)

Show the initial and final sampling meshes:

Use None to not draw any mesh:

Use 5 mesh levels in each direction:

Use 5 mesh levels in the direction and 10 in the direction:

Use mesh lines at specific values:

Use different styles for different mesh lines:

MeshFunctions  (2)

Use a mesh evenly spaced in the , , and directions:

Mesh with respect to radial distance:

MeshShading  (5)

Alternate red and blue sections in the direction:

MeshShading has higher priority than ContourStyle for styling:

Use ContourStyle for some segments by setting MeshShading to Automatic:

MeshShading can be used with ColorFunction:

Fill between regions defined by multiple mesh functions:

MeshStyle  (2)

Use a dashed mesh in the direction:

Use a dashed mesh in the direction and a blue mesh in the direction:

NormalsFunction  (3)

Normals are automatically calculated:

Use None to get flat shading for all the polygons:

Vary the effective normals used on the surface:

PerformanceGoal  (2)

Generate a higher-quality plot:

Emphasize performance, possibly at the cost of quality:

PlotLegends  (3)

Use expressions as legends:

Use Placed to change legend placement:

Use SwatchLegend to modify the legend:

PlotPoints  (1)

Use more initial points to get a smoother contour:

PlotRange  (2)

Show the contours over the Full , , range:

Automatically compute the , , range:

PlotTheme  (4)

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

Turn off the grid lines:

Use a theme with minimal styling:

Create a thick surface for 3D printing:

RegionFunction  (2)

Select a region in , , and :

Remove a wedge to see hidden features:

RegionBoundaryStyle  (4)

Show the region being plotted:

Show the region defined by a region function:

Use None to not draw the region:

Use a custom RegionBoundaryStyle:

ScalingFunctions  (4)

By default, ContourPlot3D uses linear scales in all directions:

Use a log scale in the direction:

Reverse the coordinate direction of the axis:

Use a scale defined by a function, specifying the function and its inverse:

TextureCoordinateFunction  (5)

Textures use scaled and coordinates by default:

Use the and coordinates:

Use different textures for different surfaces:

Use unscaled coordinates:

Use textures to highlight how parameters map onto a surface:

TextureCoordinateScaling  (1)

Use scaled or unscaled coordinates for textures:

WorkingPrecision  (2)

Evaluate functions using machine-precision arithmetic:

Evaluate functions using arbitrary-precision arithmetic:

Applications  (5)

Ellipsoidal surfaces [more info]:

Compute their volumes:

Conic surfaces [more info]:

Show a sphere and hyperboloids of one and two sheets:

Use Mesh to show that a hyperbolic paraboloid is a doubly ruled surface:

An implicitly defined torus [more info]:

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

Two charges and :

Two charges and :

Three charges , , and :

Properties & Relations  (8)

ContourPlot3D samples more points where it needs to:

Plotting an implicit surface is the same as finding the zero contour of a related function:

The orientation of the contours depends on the form of the input:

Use ListContourPlot3D for plotting data:

Use RegionPlot3D for implicit regions in three dimensions:

Use Plot3D for surfaces:

Use ParametricPlot3D for parametric curves and regions in three dimensions:

Use ContourPlot and DensityPlot for contours and densities in two dimensions:

Possible Issues  (3)

Use increased settings for PlotPoints or MaxRecursion to capture features of a surface:

Use more initial points to capture more components of the contour surface:

For functions that are always non-negative, it is not possible to find the 0 contour:

Neat Examples  (1)

A transcendental periodic implicit surface:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2024_contourplot3d, author="Wolfram Research", title="{ContourPlot3D}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/ContourPlot3D.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_contourplot3d, organization={Wolfram Research}, title={ContourPlot3D}, year={2022}, url={https://reference.wolfram.com/language/ref/ContourPlot3D.html}, note=[Accessed: 22-November-2024 ]}