WOLFRAM

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)Summary of the most common use cases

Plot a 3D contour surface:

Out[1]=1

Plot several contour surfaces:

Out[1]=1

Plot contours over a ball with radius three:

Out[1]=1

Use styling to emphasize features:

Out[1]=1

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

Sampling  (6)

Plot over a geometric region:

Out[2]=2

Plot over an implicitly defined region:

Out[1]=1

More points are sampled where the function changes quickly:

Out[1]=1

Areas where the function becomes nonreal are excluded:

Out[1]=1

Use PlotPoints and MaxRecursion to control adaptive sampling:

Out[1]=1

Use RegionFunction to show interior features:

Out[1]=1

Presentation  (10)

Add labels:

Out[1]=1

Color the surface by height:

Out[1]=1

Apply styles to a contour:

Out[1]=1

Show multiple implicit surfaces with explicit styles:

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

Use transparency to show interior features:

Out[1]=1

Use an overlay mesh:

Out[1]=1

Fill with different colors between mesh lines:

Out[1]=1

Legend styles with contour values automatically:

Out[1]=1

Legend contours with expressions:

Out[2]=2

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

Out[1]=1

Reverse the scale on the axis:

Out[1]=1

Options  (74)Common values & functionality for each option

BoundaryStyle  (3)

Use a red boundary around the edges of the contours:

Out[1]=1

Use None to omit the boundary:

Out[1]=1

BoundaryStyle applies to holes cut by RegionFunction:

Out[1]=1

BoxRatios  (1)

Use Automatic to show the natural scale of the surface:

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

ColorFunction  (5)

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

Out[1]=1

Use a named color gradient:

Out[1]=1

ColorFunction has higher priority than ContourStyle:

Out[1]=1

Use red when :

Out[1]=1

ColorFunction has lower priority than MeshShading:

Out[1]=1

ColorFunctionScaling  (2)

Use unscaled values to color the contours:

Out[1]=1

Use an overlay density based on the coordinate values:

Out[1]=1

Contours  (4)

Use 5 equally spaced contours:

Out[1]=1

Use automatic contour selection:

Out[1]=1

Use specific contours:

Out[1]=1

Use specific contours with specific styles:

Out[1]=1

ContourStyle  (8)

Use transparent contours:

Out[1]=1

Use distinct colors for each contour:

Out[1]=1

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

Out[1]=1

Alternate styles for contour surfaces:

Out[1]=1

Use the same style for all the equations:

Out[1]=1

Use different styles for different equations:

Out[1]=1

ColorFunction has higher priority than ContourStyle:

Out[1]=1

MeshShading has higher priority than ContourStyle:

Out[1]=1

EvaluationMonitor  (2)

Show where ContourPlot3D samples a function:

Out[1]=1

Count how many times is evaluated:

Out[1]=1

MaxRecursion  (1)

Refine the contour where it changes quickly:

Out[1]=1

Mesh  (6)

Show the initial and final sampling meshes:

Out[1]=1

Use None to not draw any mesh:

Out[1]=1

Use 5 mesh levels in each direction:

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

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

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

Use mesh lines at specific values:

Out[1]=1

Use different styles for different mesh lines:

Out[1]=1

MeshFunctions  (2)

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

Out[1]=1

Mesh with respect to radial distance:

Out[1]=1

MeshShading  (5)

Alternate red and blue sections in the direction:

Out[1]=1

MeshShading has higher priority than ContourStyle for styling:

Out[1]=1

Use ContourStyle for some segments by setting MeshShading to Automatic:

Out[1]=1

MeshShading can be used with ColorFunction:

Out[1]=1

Fill between regions defined by multiple mesh functions:

Out[1]=1

MeshStyle  (2)

Use a dashed mesh in the direction:

Out[1]=1

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

Out[1]=1

NormalsFunction  (3)

Normals are automatically calculated:

Out[1]=1

Use None to get flat shading for all the polygons:

Out[1]=1

Vary the effective normals used on the surface:

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)

Use expressions as legends:

Out[1]=1

Use Placed to change legend placement:

Out[1]=1

Use SwatchLegend to modify the legend:

Out[1]=1

PlotPoints  (1)

Use more initial points to get a smoother contour:

Out[1]=1

PlotRange  (2)

Show the contours over the Full , , range:

Out[1]=1

Automatically compute the , , range:

Out[1]=1

PlotTheme  (4)

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

Out[1]=1

Turn off the grid lines:

Out[1]=1

Use a theme with minimal styling:

Out[1]=1

Create a thick surface for 3D printing:

Out[1]=1

RegionFunction  (2)

Select a region in , , and :

Out[1]=1

Remove a wedge to see hidden features:

Out[1]=1

RegionBoundaryStyle  (4)

Show the region being plotted:

Out[2]=2

Show the region defined by a region function:

Out[1]=1

Use None to not draw the region:

Out[1]=1

Use a custom RegionBoundaryStyle:

Out[1]=1

ScalingFunctions  (4)

By default, ContourPlot3D uses linear scales in all directions:

Out[1]=1

Use a log scale in the direction:

Out[1]=1

Reverse the coordinate direction of the axis:

Out[1]=1

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

Out[1]=1

TextureCoordinateFunction  (5)

Textures use scaled and coordinates by default:

Out[1]=1

Use the and coordinates:

Out[1]=1

Use different textures for different surfaces:

Out[1]=1

Use unscaled coordinates:

Out[1]=1

Use textures to highlight how parameters map onto a surface:

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

TextureCoordinateScaling  (1)

Use scaled or unscaled coordinates for textures:

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

WorkingPrecision  (2)

Evaluate functions using machine-precision arithmetic:

Out[1]=1

Evaluate functions using arbitrary-precision arithmetic:

Out[1]=1

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

Ellipsoidal surfaces [more info]:

Out[1]=1

Compute their volumes:

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

Conic surfaces [more info]:

Out[4]=4

Show a sphere and hyperboloids of one and two sheets:

Out[1]=1

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

Out[1]=1

An implicitly defined torus [more info]:

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

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

Two charges and :

Out[3]=3

Two charges and :

Out[4]=4

Three charges , , and :

Out[5]=5

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

ContourPlot3D samples more points where it needs to:

Out[1]=1

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

Out[1]=1

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

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

Use ListContourPlot3D for plotting data:

Out[2]=2

Use RegionPlot3D for implicit regions in three dimensions:

Out[1]=1

Use Plot3D for surfaces:

Out[1]=1

Use ParametricPlot3D for parametric curves and regions in three dimensions:

Out[1]=1

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

Out[1]=1

Possible Issues  (3)Common pitfalls and unexpected behavior

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

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

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

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

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

Out[1]=1

Neat Examples  (1)Surprising or curious use cases

A transcendental periodic implicit surface:

Out[1]=1
Wolfram Research (2007), ContourPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ContourPlot3D.html (updated 2022).
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).

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.

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

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

BibTeX

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

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

BibLaTeX

@online{reference.wolfram_2025_contourplot3d, organization={Wolfram Research}, title={ContourPlot3D}, year={2022}, url={https://reference.wolfram.com/language/ref/ContourPlot3D.html}, note=[Accessed: 25-March-2025 ]}

@online{reference.wolfram_2025_contourplot3d, organization={Wolfram Research}, title={ContourPlot3D}, year={2022}, url={https://reference.wolfram.com/language/ref/ContourPlot3D.html}, note=[Accessed: 25-March-2025 ]}