2D Functions
Function Plot
Parametric Plot
Multiple Parametric Plot
Filled Plot
Multiple Filled Plot
Logarithmic Plot
2D Data Plots
Data Plot
Data Error Plot
Data Logarithmic Plot
Data Labeled Plot
Contour & Density Plots
Contour Plot
Density Plot
Level Curves
3D Functions
3D Function Plot
3D Parametric Plot
3D Multiple Parametric Plot
3D Vector Field
3D Gradient Field
Shadow 3D Function
3D Data Plots
Contour 3D Data Plot
Density 3D Data Plot
Special Plots
Vector Field
Bar Charts
Pie Chart
Zonotope Show
Links
About This Site
Citation & Credits
Sci.Vis. Tutorials
web
C
omputing
Plot of 3D Function
Generates a three-dimensional plot of a function depending on x and y.
Enter a function of x and y: 
" >
Plot function for:
" >  <= x <= 
" > ,
" >  <= y <= 
" >
with
Interactive rotation and resizing
<%Mathlet MSPBlock[ {$$func, $$xBeg, $$xEnd, $$yBeg, $$yEnd, $$h, $$xRangeBeg,$$xRangeEnd, $$yRangeBeg, $$yRangeEnd, $$zRangeBeg, $$zRangeEnd, $$clipFill, $$boxFlag, $$box1, $$box2, $$box3, $$xAxeLabel, $$yAxeLabel, $$zAxeLabel, $$xAxeValue, $$yAxeValue, $$zAxeValue, $$plotLabel, $$aspectRatio, $$lightFlag, $$meshFlag, $$imageSize, $$view1, $$view2, $$view3}, fc = {If[MSPValueQ[$$face1],MSPToExpression[$$face1],""], If[MSPValueQ[$$face2],MSPToExpression[$$face2],""], If[MSPValueQ[$$face3],MSPToExpression[$$face3],""], If[MSPValueQ[$$face4],MSPToExpression[$$face4],""], If[MSPValueQ[$$face5],MSPToExpression[$$face5],""], If[MSPValueQ[$$face6],MSPToExpression[$$face6],""]}; result = Plot3D[$$func, {x, $$xBeg, $$xEnd}, {y, $$yBeg, $$yEnd}, PlotRange->{If[$$xPlotRange === "Specified",{$$xRangeBeg,$$xRangeEnd}, MSPToExpression[$$xPlotRange]], If[$$yPlotRange === "Specified",{$$yRangeBeg,$$yRangeEnd}, MSPToExpression[$$yPlotRange]], If[$$zPlotRange ==="Specified", {$$zRangeBeg,$$zRangeEnd}, MSPToExpression[$$zPlotRange]]}, Boxed->$$boxFlag, BoxRatios->If[$$boxRatios==="Specified", {$$box1,$$box2,$$box3},Automatic], AxesEdge->{If[$$xAxeFlag === "Specified" , $$xAxeValue , MSPToExpression[$$xAxeFlag]], If[$$yAxeFlag === "Specified" , $$yAxeValue , MSPToExpression[$$yAxeFlag]], If[$$zAxeFlag === "Specified" , $$zAxeValue , MSPToExpression[$$zAxeFlag]] }, AxesLabel->{If[$$xAxeLabel === Null, "", ToString[HoldForm[$$xAxeLabel]]], If[$$yAxeLabel === Null, "", ToString[HoldForm[$$yAxeLabel]]], If[$$yAxeLabel === Null, "", ToString[HoldForm[$$zAxeLabel]]]}, FaceGrids->If[$$faceGrids === "Specified", fc, MSPToExpression[$$faceGrids]], AmbientLight->If[NumberQ[$$h],Hue[$$h],GrayLevel[0.]], ImageSize->$$imageSize, PlotLabel-> If[$$plotLabel === Null, "", ToString[HoldForm[$$plotLabel]]], ViewPoint->If[NumberQ[$$view1] && NumberQ[$$view2] && NumberQ[$$view3], {$$view1,$$view2,$$view3},{1.3,-2.4,2.}], AspectRatio->If[$$aspectRatioFlag === "Specified", $$aspectRatio, MSPToExpression[$$aspectRatioFlag]], Lighting->$$lightFlag, Mesh->$$meshFlag, ClipFill->$$clipFill ]; If[Head[result] === SurfaceGraphics, If[MSPValueQ[$$btnSubmit], MSPShow[result], If[MSPValueQ[$$btnLive], MSPLive3D[result]]]] ] %>
Save as:
> GIF and animated GIF (.gif)
>JPEG (.jpeg)
>JPEG (.jpg)
> Encapsulated PostScript (.eps)
> Mathematica abbreviated PostScript (.mps)
> Adobe Acrobat portable document format (.pdf)
> Microsoft bitmap format (.bmp)
> Encapsulated PostScript with device independent preview (.epsi)
> Encapsulated PostScript with TIFF preview (.eps)
> Mathematica independent raster graphics format (.mgf)
> Portable bitmap format (.pbm)
>TIFF (.tif)
>TIFF (.tiff)
> X window system bitmap (.xbm)
With file name:
" >
<%Mathlet MSPBlock[{$$fname, $$submitButton1}, c = If[$$fname === Null, "", ToString[HoldForm[$$fname]] ]; ftype = Switch[$$opt, "jpg", "JPEG", "tif", "TIFF", "eps", "EPSTIFF", "xbm", "XBitmap", "mps", "MPS", _ , $$opt]; If[ Head[result] === SurfaceGraphics, MSPReturn[DisplayString[result, ftype], "image/"<>ftype , c<>"."<>$$opt] ] ] %>
General options
Plot range:
active only in static mode
(All - all points are included, Automatic - outlying points are dropped)
X:
<%Mathlet MSPSetDefault[$$xPlotRange, "Automatic"] %>
> Automatic
> All
> Specified
" > < = x < =
" >
Y:
<%Mathlet MSPSetDefault[$$yPlotRange, "Automatic"] %>
> Automatic
> All
> Specified
" > < = y < =
" >
Z:
<%Mathlet MSPSetDefault[$$zPlotRange, "Automatic"] %>
> Automatic
> All
> Specified
" > < = z < =
" >
<%Mathlet MSPSetDefault[$$clipFill, "Automatic"] %>
Clip Fill :
active only in static mode
> Automatic
> None
<%Mathlet MSPSetDefault[$$boxFlag, "True"] %>
Boxed :
> True
> False
Box ratios:
<%Mathlet MSPSetDefault[$$boxRatios, "Automatic"] %>
> Automatic
> Specified
" >
" >
" >
AxesEdge :
Specifies on which edges of the bounding box the axes should be drawn.
<%Mathlet MSPSetDefault[$$xAxeFlag, "Automatic"] %> <%Mathlet MSPSetDefault[$$xAxeValue, "{+1,+1}"] %> X :
> Automatic
> None
> Specified :
> +y->+z
> +y->-z
> -y->+z
> -y->-z
<%Mathlet MSPSetDefault[$$yAxeFlag, "Automatic"] %> <%Mathlet MSPSetDefault[$$yAxeValue, "{+1,+1}"] %> Y :
> Automatic
> None
> Specified :
> +x->+z
> +x->-z
> -x->+z
> -x->-z
Z : <%Mathlet MSPSetDefault[$$zAxeFlag, "Automatic"] %> <%Mathlet MSPSetDefault[$$zAxeValue, "{+1,+1}"] %>
> Automatic
> None
> Specified :
> +x->+y
> +x->-y
> -x->+y
> -x->-y
axe1->axe2
, where axe1, axe2 = x, y, z, states that the axe will be drawn between axe1 and axe2.
The sign before axe1 and axe2 specifies whether the axe will be drawn on the edge of the box
with a larger or smaller value of axe1 and axe2 respectively.
Axes label:
active only in static mode
x label:
" > y label:
" > z label:
" >
<%Mathlet MSPSetDefault[$$meshFlag, "True"] %>
Mesh :
> True
> False
<%Mathlet MSPSetDefault[$$lightFlag, "True"] %>
Lighting :
active only in static mode
> True
> False
Plot color in Hue style:
" >
The value of Hue must be between 0 and 1
Image Size:
" >  
specifies the absolute size of an image to render
Plot label:
active only in static mode
" >
Face grids:
active only in static mode
<%Mathlet MSPSetDefault[$$faceGrids, "None"] %>
> All
> None
> Specified:
> Right YZ plane
> Left YZ plane
> Back XZ plane
> Front XZ plane
> Up XY plane
> Down XY plane
View point:
gives the position of the view point relative to the center of the three-dimensional box that contains the object being plotted. The view point is given in a special scaled coordinate system in which the longest side of the bounding box has length 1. The center of the bounding box is taken to have coordinates {0, 0, 0}.
x :
" > y :
" > z :
" >
Aspect ratio:
active only in static mode
<%Mathlet MSPSetDefault[$$aspectRatioFlag, "Automatic"] %>
> Default
> Automatic
> Specified :
" >
Setting the AspectRatio option changes the whole shape of your plot. AspectRatio gives the ratio of height to width.
Its
default
value is the inverse of the Golden Ratio - supposedly the most pleasing shape for a rectangle.
Automatic
determines the shape of the display area from the original coordinate system.
© 2004 web
C
omputing, Scientific Visualization