MathGroup Archive 1998

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

Search the Archive

Re: Stacking Graphics


Hi Eric,

the combination of a 3d surface with a contour plot will probably not
work. The reason are the polygons of the contour plot. The polygons in
the contour graphics are non-convex, in 2d this does not matter but the
3d extension fails
because Mathematica can not render 3d non-convex polygons.

If You need the color information You must combine a density graphics
with your 3d surface. You can look to the ShadowPlot3D[] function from
Graphics`Graphics3D.

If the lines of the contour plot are sufficient You may try something
like

(* Make a surface ...*)
surf=Plot3D[Sin[x*y],{x,0,Pi},{y,0,Pi}];

(* and a ContourPlot *)
cntr=ContourPlot[Cos[x*y],{x,0,Pi},{y,0,Pi}]

(* Define the height position of the contour lines *) zpos=-3.5;

cgraph=Show[{
      Graphics3D[surf], (* make a 3d graphics form the surface *)
      Graphics3D[
        First[Graphics[cntr]] /.{ p_Polygon :> Sequence[], (* make a 2d
graphics from the

ContourGraphics  and remove the polygons *)
            Line[pnts_]:> Line[Append[#,zpos] & /@ pnts]}]} (* extend
the 3d lines to 3d *)
   ]


Hope that  helps
  Jens
-----Original Message-----
From: Eric R. Bittner <bittner at UH.EDU> To: mathgroup at smc.vnet.net
Subject: [mg13342] [mg13245] Stacking Graphics


>Dear FellowMathGroupers:
>
>I need to combine a three dimensional list plot of a one set of data
>with a contour plot of another set of data.  Is there a relatively
>straight forward to do this?
>
>Cheers!
>ERB
>--
>Eric R. Bittner                 bittner at uh.edu Dept. of Chemistry
>ph: 713-743-2775 University of Houston          fax: 713-743-2709
>Houston TX 77204              http://k2.chem.uh.edu/bittner/
> "confutatis maledictis, flammis acribus addictis..."
>
>



  • Prev by Date: Re: Tree plotting package?
  • Next by Date: Re: In which interval?
  • Previous by thread: Stacking Graphics
  • Next by thread: RADON-Transformation