Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

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
> 
> 




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