MathGroup Archive 2003

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

Search the Archive

Re: Re: density plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39695] Re: [mg39675] Re: density plot
  • From: Dr Bob <drbob at bigfoot.com>
  • Date: Sat, 1 Mar 2003 22:06:10 -0500 (EST)
  • References: <200303010748.CAA09884@smc.vnet.net> <oprldok8muamtwdy@smtp.cox-internet.com>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

Or this:

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}};
dataz = data[[All, 3]];
hue = Interpolation[{{Min@dataz, 0}, {Max@dataz, 1}}, InterpolationOrder -> 
1];
size = Interpolation[{{Min@dataz, 4}, {Max@dataz, 8}}, InterpolationOrder - 
> 1];
point[dim_][p : {_, _, c_}] := {AbsolutePointSize@size@c, Hue@hue@c, 
Point@Take[p, dim]}
pts = point[3] /@ data;
Show[Graphics3D[{AbsolutePointSize[6], pts}], Axes -> True];
pts = point[2] /@ data;
Show[Graphics[{AbsolutePointSize[6], pts}], Frame -> True, AspectRatio -> 
1];

Bobby

On Sat, 01 Mar 2003 16:54:34 -0600, Dr Bob <drbob at bigfoot.com> wrote:

> Here's almost the same thing, with a little more separation of the 
> various ideas used:
>
> 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}};
> dataz = data[[All, 3]];
> hue = Interpolation[{{Min@dataz, 0}, {Max@dataz, 1}}, InterpolationOrder - 
>
>
> > 1];
> point1[p : {_, _, c_}] := {Hue@hue@c, Point@p}
> pts = point1 /@ data;
> Show[Graphics3D[{AbsolutePointSize[6], pts}], Axes -> True];
> point2[{a_, b_, c_}] := {Hue@hue@c, Point@{a, b}}
> pts = point2 /@ data;
> Show[Graphics[{AbsolutePointSize[6], pts}], Frame -> True, AspectRatio -> 
> 1];
>
> Bobby
>
> On Sat, 1 Mar 2003 02:48:29 -0500 (EST), <BobHanlon at aol.com> wrote:
>
>>
>> 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
>>
>>
>>
>>
>
>
>



-- 
majort at cox-internet.com
Bobby R. Treat



  • Prev by Date: Re: Re: density plot
  • Next by Date: Re: Re: stats
  • Previous by thread: Re: Re: density plot
  • Next by thread: Re: density plot