MathGroup Archive 2003

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

Search the Archive

Re: density plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39675] Re: density plot
  • From: BobHanlon at aol.com
  • Date: Sat, 1 Mar 2003 02:48:29 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 2/28/03 9:02:27 AM, hsu at charter.net writes:


> I have a list of data with coordinates and intensity value, such as
>
> {{0.0028989,0.332549,1.75},{0.334769,0.395588,2.},{0.469562,0.0831043,
>    
> 3.},{0.693715,0.672036,4.},{0.0111101,0.227195,1.75},{0.974097,0.623733,
>    
> 3.75},{0.905734,0.980701,4.},{0.766471,0.0168064,3.},{0.543011,0.512028,
>     3.25},{0.472721,0.573379,3.5}}
>
> I want to be able to listplot the first 2 elements of each row as the
> coordinate on R^2, and the third as color of the coordinate.  I used
> scatterplot3d and the result was not ideal.  I wrote my own function to get
> the colors to work, but I figure there is probably some builtin function
> that has better options and color scheme than the one I'm doing.  Is any
> such one out there.
>

data={{0.0028989,0.332549,1.75},{0.334769,0.395588,2.},

       {0.469562,0.0831043,3.},{0.693715,0.672036,4.},

       {0.0111101,0.227195,1.75},{0.974097,0.623733,3.75},

       {0.905734,0.980701,4.},{0.766471,0.0168064,3.},

       {0.543011,0.512028,3.25},{0.472721,0.573379,3.5}};



minz = Min[dataz = (Last /@ data)];


delz = Max[dataz]-minz;


minHue = .35;
maxHue = 1;



Show[Graphics3D[{AbsolutePointSize[6],

         {Hue[minHue+(maxHue-minHue)*(#[[3]]-minz)/delz],

               Point[#]}& /@ data}],

     Axes -> True];



Show[Graphics[{AbsolutePointSize[6],

         {Hue[minHue+(maxHue-minHue)*(#[[3]]-minz)/delz],

               Point[Take[#,2]]}& /@ data}],

     Frame -> True, AspectRatio->1];



Bob Hanlon




  • Prev by Date: Testing for invertible matrix
  • Next by Date: Re: Eigensystem
  • Previous by thread: Re: Testing for invertible matrix
  • Next by thread: Re: Re: density plot