Plot3D [f,{x,xmin,xmax},{y,ymin,ymax}]
generates a three-dimensional plot of f as a function of x and y.
Plot3D [{f1,f2,…},{x,xmin,xmax},{y,ymin,ymax}]
plots several functions.
Plot3D [{…,w[fi],…},…]
plots fi with features defined by the symbolic wrapper w.
Plot3D […,{x,y}∈reg]
takes variables {x,y} to be in the geometric region reg.
Plot3D
Plot3D [f,{x,xmin,xmax},{y,ymin,ymax}]
generates a three-dimensional plot of f as a function of x and y.
Plot3D [{f1,f2,…},{x,xmin,xmax},{y,ymin,ymax}]
plots several functions.
Plot3D [{…,w[fi],…},…]
plots fi with features defined by the symbolic wrapper w.
Plot3D […,{x,y}∈reg]
takes variables {x,y} to be in the geometric region reg.
Details and Options
- Plot3D is also known as a surface plot or surface graph.
- Plot3D evaluates f at values of x and y in the domain being plotted over and connects the points {x,y,f[x,y]} to form a surface showing how f varies with x and y.
- It visualizes the surface .
- Gaps are left at any point where the fi evaluate to anything other than real numbers.
- Plot3D treats the variables x and y as local, effectively using Block .
- Plot3D has attribute HoldAll and evaluates f only after assigning specific numerical values to x and y.
- In some cases it may be more efficient to use Evaluate to evaluate f symbolically before specific numerical values are assigned to x and y.
- The following wrappers w can be used for fi:
-
- Wrappers w can be applied at multiple levels:
-
w[fi] wrap fiw[{f1,…}] wrap a collection of fiw1[w2[…]] use nested wrappers
- Callout , Labeled and Placed can use the following positions pos:
-
Automatic automatically placed labels{x,y} near the surface at a position {x,y}{x,y,z} at the position {x,y,z}{pos,epos} epos in label placed at relative position pos of the surface
- Plot3D has the same options as Graphics3D , with the following additions and changes: [List of all options]
-
- PlotStyle->None draws no surface, so effectively does not eliminate hidden surfaces.
- Plot3D initially evaluates each function at a grid of equally spaced sample points specified by PlotPoints . Then it uses an adaptive algorithm to choose additional sample points, subdividing at most MaxRecursion times.
- You should realize that with the finite number of sample points used, it is possible for Plot3D to miss features in your functions. To check your results, you should try increasing the settings for PlotPoints and MaxRecursion .
- With the setting Mesh->All , Plot3D draws mesh lines to show all subdivisions it makes.
- The default setting MeshFunctions->{#1&,#2&} draws an x, y mesh on each surface.
- The arguments supplied to functions in MeshFunctions and RegionFunction are x, y, z. Functions in ColorFunction and TextureCoordinateFunction are by default supplied with scaled versions of these arguments.
- ColorFunction , MeshFunctions , RegionFunction , and TextureCoordinateFunction are all evaluated over each surface.
- With the default settings Exclusions->Automatic and ExclusionsStyle->None , Plot3D breaks surfaces at discontinuity curves it detects. Exclusions->None joins across discontinuities.
- Possible settings for ScalingFunctions include:
-
sz scale the z axis{sx,sy} scale x and y axes{sx,sy,sz} scale x, y and z axes
- Each scaling function si is either a string "scale" or {g,g-1}, where g-1 is the inverse of g.
- Plot3D returns Graphics3D [GraphicsComplex [data]].
- Themes that affect 3D surfaces include:
-
"DarkMesh" dark mesh lines"GrayMesh" gray mesh lines"LightMesh" light mesh lines"ZMesh" vertically distributed mesh lines"ThickSurface" add thickness to surfaces"FilledSurface" add filling below surfaces
-
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 (4)
Plot a function:
Plot several functions:
Restrict the domain:
Plot functions with branch cuts:
Scope (26)
Sampling (11)
More points are sampled where the function changes quickly:
The plot range is selected automatically:
Areas where the function becomes nonreal are excluded:
The surface is split when there are discontinuities in the function:
Use PlotPoints and MaxRecursion to control adaptive sampling:
Use PlotRange to focus in on areas of interest:
Use Exclusions to remove curves or split the resulting surface:
Use RegionFunction to restrict the surface to a region given by inequalities:
The domain may be specified by a region:
The domain may be specified by a MeshRegion :
Plot over an infinite domain:
Labeling and Legending (6)
Label surfaces with Labeled :
Label surfaces with PlotLabels :
Place the label near the surface at an {x,y} value:
Use Callout :
Place a label with a specific location:
Include legends for each surface:
Use Legended to provide a legend for a specific curve:
Use Placed to change the legend location:
Presentation (9)
Provide an explicit PlotStyle for the surface:
Provide separate styles for different surfaces:
Add labels:
Color the surface by height:
Add a legend:
Use a theme with bright colors and height-based mesh lines:
Style the areas between mesh lines:
Provide an interactive Tooltip for a surface:
Fill below a surface:
Options (103)
Background (1)
Use colored backgrounds:
BoundaryStyle (6)
Use a black boundary around the edges of the surface:
Use a thick boundary around the edges of the surface:
Use a thick, red boundary around the edges of the surface:
Do not use any boundary:
BoundaryStyle applies to holes cut by RegionFunction :
BoundaryStyle does not apply to holes cut by Exclusions :
BoxRatios (2)
ClippingStyle (4)
Clipped regions use different surface colors by default:
Do not draw clipped regions:
Make clipped regions partially transparent:
Color clipped regions red at the bottom and blue at the top:
ColorFunction (6)
Color according to the and coordinates:
Color by scaled coordinate:
Use ColorData for predefined color gradients:
Named color gradients color in the direction:
ColorFunction has higher priority than PlotStyle :
ColorFunction has lower priority than MeshShading :
ColorFunctionScaling (2)
Use unscaled coordinates:
Use scaled coordinates in the direction and unscaled coordinates in the and directions:
EvaluationMonitor (2)
Show where Plot3D samples a function:
Count how many times is evaluated:
Exclusions (5)
This uses automatic methods to compute exclusions, in this case from branch cuts:
Indicate that no exclusions should be computed:
Give a set of exclusions as list of equations:
Use a condition with the exclusion equation:
Use both automatically computed and explicit exclusions:
ExclusionsStyle (3)
Style the boundary with a thick, blue line:
Style the boundary with a thick, blue line and the surface in between transparent:
Use a transparent surface in the exclusion cuts:
Filling (4)
Fill to the bottom:
Filling occurs along the region cut by the RegionFunction :
Fill to both top and bottom:
Fill surface 1 to the bottom with blue and surface 2 to the top with red:
FillingStyle (3)
Fill to the bottom with a variety of styles:
Fill to the plane with red below and blue above:
Fill to the plane from below only:
LabelingSize (2)
Textual labels are shown at their actual sizes:
Specify a maximum size for textual labels:
Image labels are automatically resized:
Specify a maximum size for image labels:
Show image labels at their natural sizes:
MaxRecursion (1)
Refine the surface where it changes quickly:
Mesh (6)
Use no mesh:
Show the initial and final sampling meshes:
Use 5 mesh lines in each direction:
Use 3 mesh lines in the direction and 6 mesh lines in the direction:
Use mesh lines at specific values:
Use different styles for different mesh lines:
MeshFunctions (3)
Use the value as the mesh function:
Use mesh lines in the and directions:
Use mesh lines corresponding to fixed distances from the origin:
MeshShading (4)
Use None to remove regions:
Lay a checkerboard pattern over a surface:
MeshShading has a higher priority than PlotStyle :
MeshShading has a higher priority than ColorFunction :
MeshStyle (2)
Use red mesh lines:
Use red mesh lines in the direction and thick mesh lines 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:
PlotLabels (3)
Specify text to label surfaces:
Specify a label:
Use callouts to identify the curves:
PlotLegends (5)
Use placeholders to identify plot styles:
Use specific labels:
Use the respective expressions:
Use Placed to control legend position:
Use SwatchLegend to change the appearance:
Create a legend based on a color function:
Use BarLegend to change the appearance:
PlotPoints (2)
Use more initial points to get a smoother surface:
Use 20 initial points in the direction and 5 in the direction:
PlotRange (5)
Automatically compute the range:
Use all points to compute the range:
Show the surface over the full , range:
Automatically compute the , range:
Use an explicit range to emphasize features:
PlotStyle (5)
Color a surface with diffuse orange:
Use Specularity to get highlights:
Use Opacity to get transparent surfaces:
Use separate styles for each of the surfaces:
Produce a wire mesh:
PlotTheme (2)
Use a theme with grid lines and a legend:
Turn off the grid lines:
Create a thick surface for 3D printing:
RegionFunction (4)
Plot over an annulus region in and :
Filling will fill from the region boundary:
Regions do not have to be connected:
Use any logical combination of conditions:
ScalingFunctions (9)
By default, plots have linear scales in each direction:
Use a log scale in the direction:
Use a linear scale in the direction that shows smaller numbers at the top:
Use a reciprocal scale in the direction:
Use different scales in the and directions:
Reverse the axis without changing the axis:
Use a scale defined by a function and its inverse:
Positions in Ticks are automatically scaled:
PlotRange is automatically scaled:
TextureCoordinateFunction (4)
Textures use scaled and coordinates by default:
Use the and parameters:
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 (17)
Basic Applications (7)
Make the surface partially transparent to see its inner structure:
Use MeshShading to create holes in the surface to see its inner structure:
Use MeshFunctions to also specify the slices to use:
Plot and together and guess that :
This is indeed true:
Show that TemplateBox[{p, infty}, Norm2]<=TemplateBox[{p, 2}, Norm2]<=TemplateBox[{p, 1}, Norm2] by plotting their surfaces:
Prove it:
Understand how a family of functions relate to each other:
The , , , and norms, with the unit norm mesh line:
Plot a saddle surface; the mesh curves show where the function is zero:
Functions Features (2)
Use a RegionFunction to create a cutout to understand limit behavior:
There are different limits when approaching along different lines:
Highlight the local extrema for a function using MeshFunctions :
The red curves where indicate local extrema for each fixed :
Similarly the blue curves where indicate local extrema for each fixed :
The intersections of the red and blue curves are the points where and :
Gradient Fields (2)
Plot the stream lines of the gradient field on top of the surface:
Plot the gradient vector field on top of the function surface:
Epigraph and Hypograph (2)
Complex Functions (2)
Show the real and imaginary parts of :
Show the different complex components for a function:
Other Applications (2)
This shows the solution to the heat equation in one dimension:
Plot an iterated logistic map as a function of parameter and initial value:
Properties & Relations (8)
Plot3D samples more points where it needs to:
Plot3D is a special case of ParametricPlot3D :
Use ListPlot3D for plotting data:
ComplexPlot3D plots the magnitude of a function as height and colors using the phase:
Use Plot for univariate functions:
Use ParametricPlot for plane parametric curves and regions:
Use ContourPlot3D and RegionPlot3D for implicit surfaces and regions:
Use DensityPlot and ContourPlot for densities and contours:
Neat Examples (2)
The branch cuts of inverse trigonometric functions:
Real and imaginary parts as mesh functions:
Tech Notes
Related Guides
History
Introduced in 1988 (1.0) | Updated in 2007 (6.0) ▪ 2010 (8.0) ▪ 2012 (9.0) ▪ 2014 (10.0) ▪ 2016 (11.0) ▪ 2017 (11.1) ▪ 2019 (12.0) ▪ 2021 (13.0)
Text
Wolfram Research (1988), Plot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/Plot3D.html (updated 2021).
CMS
Wolfram Language. 1988. "Plot3D." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Plot3D.html.
APA
Wolfram Language. (1988). Plot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Plot3D.html
BibTeX
@misc{reference.wolfram_2025_plot3d, author="Wolfram Research", title="{Plot3D}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/Plot3D.html}", note=[Accessed: 24-October-2025]}
BibLaTeX
@online{reference.wolfram_2025_plot3d, organization={Wolfram Research}, title={Plot3D}, year={2021}, url={https://reference.wolfram.com/language/ref/Plot3D.html}, note=[Accessed: 24-October-2025]}