Bug fix:
Contourplot bugs
There are several bugs affecting contourplot in the plots package. The following two bugs can be remedied by using the procedure patchcontourplot from the Maple Advisor Database to install a patch.
> with(plots,contourplot):
> contourplot(x/y,x=1..2,y=1..2);
> contourplot(x+y,x=0..1,y=0..x,coloring=[red,blue]);
> savelibname:= "c:/advisor";
Now run patchcontourplot() . A warning will result if you attempt to install the patch in a directory whose name does not include the word "advisor", and you will be asked to confirm that this directory is the proper target. This is intended to prevent you from accidentally writing to Maple's own "lib" or "update" libraries.
> patchcontourplot();
Now the examples above should work:
> contourplot(x/y,x=1..2,y=1..2);
> contourplot(x+y,x=0..1,y=0..x,coloring=[red,blue]);
> contourplot(r*cos(theta),r=0..3,theta=0..Pi,coords=polar);
Error, (in plot/iplot2d/patch) cannot convert to coordinate system polar
Three-dimensional coordinate systems do work, but not in the way you might expect.
> contourplot(r*cos(theta),r=0..3,theta=0..Pi,coords=cylindrical,scaling=constrained);
It seems that contourplot(f(u,v), u=a..b, v=c..d, coords=cylindrical) actually plots the projection in the xy plane of the contours of the surface , i.e. the curves for different values of the constant .
To produce a contour plot in a two-dimensional coordinate system, use the Maple Advisor Database function changecoords2d .
> changecoords2d(contourplot(r*cos(theta),r=0..3, theta=0..2*Pi,scaling=constrained), polar);
To make a contour plot using a three-dimensional coordinate system such as cylindrical coordinates (plotting the level curves of ), you can use the parametric version of contourplot .
> contourplot([r,theta,r*cos(theta)], r=0..3, theta=0..2*Pi, coords=cylindrical, scaling=constrained);
> contourplot((2*x+y)/(x^2-y),x=-3..3,y=-3..3,contours=[-1,0,1]);
A work-around for this is to change either the definition of the function or the rectangle very slightly so that grid points will not be so very close to (or exactly on) the curve.
> contourplot((2*x+y)/(x^2-y),x=-3..3,y=-3.00001..3.00002,contours=[-2,0,2],axes=box,grid=[40,40]);
See also: changecoords2d , contourplot , coords , How many contours? , labelledcontourplot , plot[options] , plots
Maple Advisor Database R. Israel, 2000