Examples of Contour Plots (Level Curves)
Dr. K. G. TeBeest
> with( plots ) :
Warning, the name changecoords has been redefined
Plot the paraboloid
> f := x^2 + y^2 ;
> plot3d( f, x = -4 .. 4, y = -4 .. 4, style = patchcontour, axes = framed ) ;
Plot the contour plot (level curves) of the same paraboloid. Let's plot the
level curves
> contourplot( f, x = -4 .. 4, y = -4 .. 4, contours = [0,1,2,3,4,5,6], scaling = constrained, color = blue ) ;
Plot the hyperbolic paraboloid
> f := y^2 - x^2 ;
> plot3d( f, x = -4 .. 4, y = -4 .. 4, style = patchcontour, axes = framed ) ;
Plot the contour plot (level curves) of the same hyperbolic paraboloid.
> contourplot( f, x = -4 .. 4, y = -4 .. 4, scaling = constrained ) ;
Plot the function
> f := - x * y * exp(-x^2-y^2) ;
> plot3d( f, x = -3 .. 3, y = -3 .. 3, axes = framed, grid = [41,41] ) ;
Plot the contour plot (level curves) of the same surface with the number of contours set to 12.
> contourplot( f, x = -3 .. 3, y = -3 .. 3, scaling = constrained, grid = [51,51], color = blue, contours = 12 ) ;
Plot the function
> f := exp( -(x^2+y^2) / 10 ) * cos( x^2+y^2 ) ;
> plot3d( f, x = -3 .. 3, y = -3 .. 3, axes = framed, grid = [41,41] ) ;
Plot the contour plot (level curves) of the same surface with the number of contours set to 8.
> contourplot( f, x = -3 .. 3, y = -3 .. 3, scaling = constrained, grid = [51,51], color = blue, contours = 8 ) ;
Dr. K. G. TeBeest
Applied Mathematics
Kettering University