 Application Center - Maplesoft

# Contour plot in 3-D space

You can switch back to the summary page by clicking here.

ContourPlot3d.mws

Contour Plot in 3-Dimensions

? 1998 Waterloo Maple Inc.

NOTE: This worksheet demonstrates how to convert a 2D contour plot into a 3-Dimensional surface (and contour projection)  using  MapleV.

Introduction

This example uses Maple V's 'plottools' package to transform a 2D contour plot into 3-dimensional space.

 > restart:

 > dropshadowplot := proc(F::algebraic, r1::name=range,r2::name=range,r3::name=range)        local minz, p2, p3, coption, opts, f,g,x,y;        opts := [args[5..nargs]];        if not hasoption(opts,'contours',coption,'opts')           then coption :=8;        fi;        if type(r3,range) then          minz := lhs(r3);        else          minz := lhs(rhs(r3));        fi;        minz := evalf(minz);        p3 := plots[contourplot3d](F,r1,r2,'contours'=coption,op(opts));        p2 := plots[contourplot](F,r1,r2,'contours'=coption,op(opts));        g := unapply([x,y,minz],x,y);        f := plottools[transform](g);        plots[display]([f(p2),p3]); end:

Example

 > expr := -5*x/(x^2+y^2+1); > dropshadowplot(expr, x=-3..3, y=-3..3, z=-4..3, filled=true,   contours=6, axes=frame); >