MathGroup Archive 2009

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

Search the Archive

Re: contourplot in xy plane of Graphics3D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102989] Re: contourplot in xy plane of Graphics3D
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Thu, 3 Sep 2009 07:11:00 -0400 (EDT)
  • References: <h7l8qg$34s$1@smc.vnet.net>

On 2009.09.02. 10:02, Tobias Baumann wrote:
> Hi All
>
> I need to show a contourplot in the xy-plane of an Graphics3D. I tried
> with inset, but it doesn't work because there's an error message: "Inset
> is not a Graphics3D primitive or directive."
>

There is probably a better solution than this, but simply extending all 
the coordinate pairs to coordinate-triples should work.  ContourPlot 
produces a single GraphicsComplex object, so fortunately all the 2D 
coordinate-pairs are in one list:

cp = ContourPlot[Sin[x] + Sin[y], {x, -5, 5}, {y, -5, 5},
   ContourShading -> None]

Graphics3D[
  Replace[
   First[cp],
   GraphicsComplex[points_, objects_] :>
    GraphicsComplex[Append[#, 0 ] & /@ points, objects]
   ]
  ]

I hope this helps,
Szabolcs

P.S.  If you decide to keep the contour shading, you'll probably want to 
adjust the lighting of the 3D scene too, to "Neutral" or something similar.


  • Prev by Date: Re: Frequency shifting an audio file tia sal22
  • Next by Date: Re: re-grouping expressions in mathematica
  • Previous by thread: Re: contourplot in xy plane of Graphics3D
  • Next by thread: Re: contourplot in xy plane of Graphics3D