Re: waterfall plot in Mathematica
- To: mathgroup@smc.vnet.net
- Subject: [mg12591] Re: waterfall plot in Mathematica
- From: "Allan Hayes" <hay@haystack.demon.cc.uk>
- Date: Mon, 25 May 1998 14:25:02 -0400
- References: <6k7ehk$1nk@smc.vnet.net>
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