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

Examples

open allclose all

Basic 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)

Automatic uses the natural scale from PlotRange:

Use BoxRatios to emphasize some particular feature, in this case a saddle surface:

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)

The epigraph of a function is given by . You can visualize the epigraph using Filling:

The hypograph of a function is given by . You can visualize the hypograph using Filling:

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:

Wolfram Research (1988), Plot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/Plot3D.html (updated 2021).

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_2024_plot3d, author="Wolfram Research", title="{Plot3D}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/Plot3D.html}", note=[Accessed: 13-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_plot3d, organization={Wolfram Research}, title={Plot3D}, year={2021}, url={https://reference.wolfram.com/language/ref/Plot3D.html}, note=[Accessed: 13-November-2024 ]}