MathGroup Archive 2002

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

Search the Archive

Re: Colored ListPlot

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

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;
  {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 },
   {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 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