MathGroup Archive 2005

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

Search the Archive

Re: How to plot individual 2D data points, where each must have its own color.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58988] Re: [mg58957] How to plot individual 2D data points, where each must have its own color.
  • From: "David Park" <djmp at earthlink.net>
  • Date: Tue, 26 Jul 2005 04:01:53 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Chrisantha,

It always helps if a poster can supply some actual sample data. Then a
responder doesn't have to make up data that may not reflect your actual form
of data. In any case, here is some sample data where the third item is a Hue
color.

data = Table[{x, Sin[x], Hue[x/(2Pi)]}, {x, 0.0, 2Pi, 2Pi/20}]

Show[Graphics[
      {AbsolutePointSize[6],
       {Part[#, 3], Point[Take[#, 2]]} & /@ data}],
    Frame -> True,
    ImageSize -> 450];

What I did was use a pure function, {Part[#, 3], Point[Take[#, 2]]} &, that
extracted the third part of the data list to specify the color first, and
then applied a Point to the first two parts. This was Mapped onto the data
points.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: Chrisantha [mailto:ctf20 at sussex.ac.uk]
To: mathgroup at smc.vnet.net


Dear All,

I have a list of data


A = {{x,y,z}, {x2,y2,z2}.....{xn,yn,zn}}

where x, and y are coordinates of points, and z is the color of that
point. How can I plot this on a 2D plot?

Yours Ever,
Chrisantha Fernando.

www.chrisantha.com
Dept. of Biology.
University of Sussex.



  • Prev by Date: Re: Passing options through user-defined functions
  • Next by Date: Re: Re: Casting a Command as a String
  • Previous by thread: Re: How to plot individual 2D data points, where each must have its own color.
  • Next by thread: Freeware Mathematica packages(don't know the exact term)