MathGroup Archive 1998

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

Search the Archive

Re: waterfall plot in Mathematica




Trubatch David wrote in message <6k7ehk$1nk@smc.vnet.net>...

-----------------------------------------------------------------------
>In Matlab there is a 3-D (surface) plot command called "waterfall". This
>command produces a surface plot with meshline in only one direction--
>i. e. a surface ruled by a collection of parallel curves.
>
>I have not been able to figure out how to make such a plot with
>Mathematica. There is no option to change the style of one set of
>meshlines in "Surface" graphics object. I could use "StackGraphics" and
>"ParametricPlot" to plot a set of parallel lines, but then the lines
>that ought to be hidden by the `surface' show through and the plot is a
>mess. I even tried to simultaneoulsy plot a white, meshless surface and
>the set of stacks parametric lines, but the lines get all mixed up in
>the surface.
>

----------------------------------------------------------------------

David,
It seems that we need to operate on the polygons that make up the
surface. Here is a sample rule

meshchange=
 Polygon[{a_, b_, c_, d_}] :>
    Sequence[
     Thickness[0.01], {Hue[0],
     Line[{a, b}], Line[{c, d}]},
     {Hue[2/3], Dashing[{0.01, 0.02}],
      Line[{b, c}], Line[{d, a}]}
    ];

Use this on a Graphics3D object to get a mesh of lines.

(For SurfacePlot object sg, for example produced by Plot3D, we must
convert to a Graphics3D object by evaluating Graphics3D[sg])

Show these lines along with the the original with mesh turned off( Mesh
-> False for Plot3D; fourth entry  EdgeForm[] for ParametricPlot3D)

More about this in the next issue of Mathematica in Education and
Research (How and Why? column)

------------------------------------------------------------- Allan
Hayes
Training and Consulting
Leicester UK
http://www.haystack.demon.co.uk
hay@haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44(0)116 271 8642





  • Prev by Date: Re: A Bug / Feature
  • Next by Date: Re: A Bug / Feature
  • Prev by thread: waterfall plot in Mathematica
  • Next by thread: Re: waterfall plot in Mathematica