> with (plots);
> plot3d(x^2+y^2,x=-2..2,y=-2..2);
To draw the coordinate exaes, use either "Normal" from the Axes menu of the 3D display window, or enter axes=normal as an option in plot3d. To obtain more accurate graphs of certain functions, it is helpful to use the option numpoints , for example,
> plot3d(x^2+y^2,x=-2..2,y=-2..2,axes=normal,numpoints=1000);
To see the details of the graph around a particular point, it is useful to zoom in. To do this, for example, around the point (1,1), make a new plot with a different ranges of x and y:
> plot3d(x^2+y^2,x=-0.9..1.1,y=-0.9..1.1,axes=normal);
> contourplot(x^2+y^2,x=-2..2,y=-2..2,scaling=constrained,
axes=normal);
The option scaling=constrained is added here to make for a more accurate plot - without it the level curves (which are circles) would look like ellipses. To increase or decrease the number of level curves drawn you may want to use option contours . For example, contours=15 specifies 15 contours in the plot.
In general, the result of contourplot looks like a topographical map of a landscape where the value of f at a point represents the elevation. Such a map shows the general features of the landscape by drawing curves through points which have the same elevation. Notice that in the example above the level curves are not evenly spaced - their higher concentration further away from the origin indicates that the graph is getting steeper. Also notice that there is a minimum in the center of the picture. Try the same plot with a larger number of contours to see a family of smaller and smaller circles shrinking to the origin.
The command contourplot does not allow to plot a level curve f(x,y)=c for a specific value of c. There is however another Maple command that will do just that. For example,
> implicitplot(x^2+y^2=1,x=-2..2,y=-2..2,scaling=constrained);
will plot a circle of radius
1.
> implicitplot3d(9*x^2
+ 4*y^2 + z^2 = 1,x=-1..1,y=-1..1,z=-1..1,
scaling=constrained);
plots the ellipsoid 9x2+4y2+z2=1
which is a level surface of the function f(x,y,z)=9x2+4y2+z2
.