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[#[[3]]], PointSize[.01], Point[{#[[1]],#[[2]]}]}]&/@ 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[#[[3]]], PointSize[.01], Point[{#[[1]],#[[2]]}]}]& /@ (data /. {x_,y_,z_} -> {x, y, (z-m[[1]])/(m[[2]]-m[[1]])}), 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 > >