MathGroup Archive 2011

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

Search the Archive

Re: Question about a CountorPlot3D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117524] Re: Question about a CountorPlot3D
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Mon, 21 Mar 2011 06:18:07 -0500 (EST)
  • References: <im4iuk$d49$1@smc.vnet.net>

Iván Lazaro wrote:

> Hi all!
>
> This may be silly, but I want to know if is posible to make a CountorPlot3D
> like the one is shown in the link.
>
> I'm specially interested in the "projection". Is it possible?
>
> Thanks a lot!
>
> Image:
> http://209.85.62.24/28123/36/0/p397406/Wigner.jpg

Some years ago Jens-Peer Kuska posted a solution:

fun = Sin[x*y];
dpl = DensityPlot[fun, {x, -Pi, Pi}, {y, -Pi, Pi}];
plt3d = Plot3D[fun, {x, -Pi, Pi}, {y, -Pi, Pi}];

Head /@ {dpl, dpl[[1]], plt3d,plt3d[[1]]}

Show[
 Graphics3D[{
   plt3d[[1]], 
   dpl[[1]] /. 
    GraphicsComplex[pnts_, data__] :> 
     GraphicsComplex[(Append[#1, -2] &) /@ pnts, data]}],
 Axes -> True]

 As you can see, dpl is a 2D Graphics object, realised by
 GraphicsComplex. The replacement rule makes all points {x,y} to
 {x,y,-2}, so creating a 3D GraphicsComplex, wich can be rendered by
 Graphics3D.
 
//Peter
-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: NonlinearModelFit: Freezing parameters
  • Next by Date: Re: Following position change in different vectors
  • Previous by thread: Re: Question about a CountorPlot3D
  • Next by thread: Re: Question about a CountorPlot3D