       Re: Colored ListPlot

• To: mathgroup at smc.vnet.net
• Subject: [mg36902] Re: Colored ListPlot
• From: Selwyn Hollis <slhollis at earthlink.net>
• Date: Tue, 1 Oct 2002 04:45:47 -0400 (EDT)
• References: <an8sm0\$6r6\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Here's one possibility. If I can assume that the zi's are numbers
between 0 and 1, such as in

data= Table[{Random[], Random[], Random[]}, {100}];

then this will do the trick:

colorfn = Hue;
Show[Graphics[
{colorfn[#[]], PointSize[.01], Point[{#[],#[]}]}]&/@ data,
Axes -> True]

If the zi's need to be scaled, then you can do something like this:

colorfn = Hue[.67#]&;
With[{ m = {Min[#],Max[#]}&@vals },
Show[Graphics[
{colorfn[#[]], PointSize[.01], Point[{#[],#[]}]}]& /@
(data /. {x_,y_,z_} -> {x, y, (z-m[])/(m[]-m[])}),
Axes -> True]]

---
Selwyn Hollis

Moranresearch at aol.com wrote:
> I have a list of points l1={xi,yi,zi} how can I make a 2D list plot of
> {xi,yi} where the color of each point is zi ? Thank you. John
>
>

```

• Prev by Date: Re: Colored ListPlot
• Next by Date: RE: Colored ListPlot
• Previous by thread: Re: Colored ListPlot
• Next by thread: RE: Colored ListPlot