MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Contour curves & sections onto a surface

  • To: mathgroup at
  • Subject: [mg22189] Re: [mg22136] Contour curves & sections onto a surface
  • From: "David Park" <djmp at>
  • Date: Thu, 17 Feb 2000 01:24:25 -0500 (EST)
  • Sender: owner-wri-mathgroup at


There are probably various implementations of this. I have one implementation in my
DrawingCube package available at my web site. The package allows you to draw the
surface and then add contour lines to it. Here are the usage messages for
DrawContourLines and its option.

DrawContourLines::usage =
    "DrawContourLines[f[x, y], {x, xmin, xmax}, {y, ymin, ymax}, opts] will \
extract the 2D contours from a ContourPlot and raise them to primitive \
Graphics3D objects. f[x, y] must be a defined function, not just an \
expression. In plotting contours on a surface, it is useful to lower the \
surface slightly so it will not intersect the contours. Alternatively, the \
option DrawContourOffset can be used to specify an offset for the contour \

DrawContourOffset::usage = "DrawContourOffset is an option for \
DrawContourLines which specifies an offset, in the normal plot coordinates, \
for rendering the contour lines. Generally, the contours should be slightly \
raised so they won't intersect the surface polygons. The default value is \

The tutorial has an example of a 3D plot with contour lines.

The package also makes it easy to piece together various surfaces into one plot.

David Park
djmp at

>Want to plot a surface, graph of f[x, y], and then, on the surface,
>  (1) at the actual z-height, the contour curve for that height; and/or
>  (2) at the actual value x = x0, draw on the curve the section
>("slice") of the curve f[x0, y] (and similarly for fixing y = y0).
>I know how to do all that, I think.  But I want the result to look just
>right.  To do that, the curves have to be a different color, or possibly
>thicker, but -- most important -- be displaced a bit from the actual
>surface so as to be distinctly visible.
>Somewhere -- in this newsgroup, on the Wolfram web site, in a
>Mathematica book, or in one of journals (Mathematica in Research and
>Education, The Mathematica Journal) -- I once saw a very cleanly done
>implementation that produces very nice results.
>Can anyone supply a pointer to that?
>Murray Eisenberg                     murray at
>Mathematics & Statistics Dept.       phone 413 549-1020 (H)
>Univ. of Massachusetts                     413 545-2859 (W)
>Amherst, MA 01003-4515

  • Prev by Date: Re: LogLogPlot trouble
  • Next by Date: Re: Setting up a probability problem
  • Previous by thread: Re: Contour curves & sections onto a surface
  • Next by thread: Re: Contour curves & sections onto a surface