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:
-
Annotation[fi,label] provide an annotation for fi Button[fi,action] evaluate action when the curve for fi is clicked Callout[fi,label] label the function with a callout Callout[fi,label,pos] place the callout at relative position pos EventHandler[fi,events] define a general event handler for fi Hyperlink[fi,uri] make the function a hyperlink Labeled[fi,label] label the function Labeled[fi,label,pos] place the label at relative position pos Legended[fi,label] identify the function in a legend PopupWindow[fi,cont] attach a popup window to the function StatusArea[fi,label] display in the status area on mouseover Style[fi,styles] show the function using the specified styles Tooltip[fi,label] attach a tooltip to the function Tooltip[fi] use functions as tooltips - Wrappers w can be applied at multiple levels:
-
w[fi] wrap fi w[{f1,…}] wrap a collection of fi w1[w2[…]] use nested wrappers - Callout, Labeled and Placed can use the following positions pos:
-
Automatic automatically placed labels Above, Below, Before, After positions around the surface {x,y} near the surface at a position {x,y} {x,y,z} at the position {x,y,z} {s,Above},{s,Below},… relative position at position s around the surface {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]
-
Axes True whether to draw axes BoundaryStyle Automatic how to draw boundary lines for surfaces BoxRatios {1,1,0.4} bounding 3D box ratios ClippingStyle Automatic how to draw clipped parts of surfaces ColorFunction Automatic how to determine the color of surfaces ColorFunctionScaling True whether to scale arguments to ColorFunction EvaluationMonitor None expression to evaluate at every function evaluation Exclusions Automatic x, y curves to exclude ExclusionsStyle None what to draw at excluded curves Filling None filling under each surface FillingStyle Opacity[0.5] style to use for filling LabelingSize Automatic maximum size of callouts and labels MaxRecursion Automatic the maximum number of recursive subdivisions allowed Mesh Automatic how many mesh lines in each direction to draw MeshFunctions {#1&,#2&} how to determine the placement of mesh lines MeshShading None how to shade regions between mesh lines MeshStyle Automatic the style for mesh lines Method Automatic the method to use for refining surfaces NormalsFunction Automatic how to determine effective surface normals PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabels None labels to use for surfaces PlotLegends None legends for surfaces PlotPoints Automatic the initial number of sample points in each direction PlotRange {Full,Full,Automatic} the range of z or other values to include PlotStyle Automatic graphics directives for the style for each surface PlotTheme $PlotTheme overall theme for the plot RegionFunction (True&) how to determine whether a point should be included ScalingFunctions None how to scale individual coordinates TextureCoordinateFunction Automatic how to determine texture coordinates TextureCoordinateScaling True whether to scale arguments to TextureCoordinateFunction WorkingPrecision MachinePrecision the precision used in internal computations - 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 -
AlignmentPoint Center the default point in the graphic to align with AspectRatio Automatic ratio of height to width Axes True whether to draw axes AxesEdge Automatic on which edges to put axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} graphics directives to specify the style for axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic BoundaryStyle Automatic how to draw boundary lines for surfaces Boxed True whether to draw the bounding box BoxRatios {1,1,0.4} bounding 3D box ratios BoxStyle {} style specifications for the box ClippingStyle Automatic how to draw clipped parts of surfaces ClipPlanes None clipping planes ClipPlanesStyle Automatic style specifications for clipping planes ColorFunction Automatic how to determine the color of surfaces ColorFunctionScaling True whether to scale arguments to ColorFunction ContentSelectable Automatic whether to allow contents to be selected ControllerLinking False when to link to external rotation controllers ControllerPath Automatic what external controllers to try to use Epilog {} 2D graphics primitives to be rendered after the main plot EvaluationMonitor None expression to evaluate at every function evaluation Exclusions Automatic x, y curves to exclude ExclusionsStyle None what to draw at excluded curves FaceGrids None grid lines to draw on the bounding box FaceGridsStyle {} style specifications for face grids Filling None filling under each surface FillingStyle Opacity[0.5] style to use for filling FormatType TraditionalForm default format type for text ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels, etc. ImageSize Automatic absolute size at which to render the graphic LabelingSize Automatic maximum size of callouts and labels LabelStyle {} style specifications for labels Lighting Automatic simulated light sources to use MaxRecursion Automatic the maximum number of recursive subdivisions allowed Mesh Automatic how many mesh lines in each direction to draw MeshFunctions {#1&,#2&} how to determine the placement of mesh lines MeshShading None how to shade regions between mesh lines MeshStyle Automatic the style for mesh lines Method Automatic the method to use for refining surfaces NormalsFunction Automatic how to determine effective surface normals PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabel None a label for the plot PlotLabels None labels to use for surfaces PlotLegends None legends for surfaces PlotPoints Automatic the initial number of sample points in each direction PlotRange {Full,Full,Automatic} the range of z or other values to include PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic final display region to be filled PlotStyle Automatic graphics directives for the style for each surface PlotTheme $PlotTheme overall theme for the plot PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} 2D graphics primitives to be rendered before the main plot RegionFunction (True&) how to determine whether a point should be included RotationAction "Fit" how to render after interactive rotation ScalingFunctions None how to scale individual coordinates SphericalRegion Automatic whether to make the circumscribing sphere fit in the final display area TextureCoordinateFunction Automatic how to determine texture coordinates TextureCoordinateScaling True whether to scale arguments to TextureCoordinateFunction Ticks Automatic specification for ticks TicksStyle {} style specification for ticks TouchscreenAutoZoom False - whether to zoom to fullscreen when activated on a touchscreen
ViewAngle Automatic angle of the field of view ViewCenter Automatic point to display at the center ViewMatrix Automatic explicit transformation matrix ViewPoint {1.3,-2.4,2.} viewing position ViewProjection Automatic projection method for rendering objects distant from the viewer ViewRange All range of viewing distances to include ViewVector Automatic position and direction of a simulated camera ViewVertical {0,0,1} direction to make vertical WorkingPrecision MachinePrecision the precision used in internal computations
List of all options
Examples
open allclose allBasic Examples (4)
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:
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:
Options (103)
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:
BoundaryStyle applies to holes cut by RegionFunction:
BoundaryStyle does not apply to holes cut by Exclusions:
BoxRatios (2)
ClippingStyle (4)
ColorFunction (6)
Color according to the and coordinates:
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)
EvaluationMonitor (2)
Exclusions (5)
ExclusionsStyle (3)
Filling (4)
Filling occurs along the region cut by the RegionFunction:
Fill surface 1 to the bottom with blue and surface 2 to the top with red:
FillingStyle (3)
LabelingSize (2)
Mesh (6)
MeshFunctions (3)
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)
NormalsFunction (3)
Normals are automatically calculated:
Use None to get flat shading for all the polygons:
PerformanceGoal (2)
PlotLabels (3)
PlotLegends (5)
Use placeholders to identify plot styles:
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)
PlotRange (5)
PlotStyle (5)
Color a surface with diffuse orange:
Use Specularity to get highlights:
Use Opacity to get transparent surfaces:
PlotTheme (2)
RegionFunction (4)
Plot over an annulus region in and :
Filling will fill from the region boundary:
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)
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 :
Show that by plotting their surfaces:
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)
Epigraph and Hypograph (2)
Complex Functions (2)
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:
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