Re: plot coloring
- To: mathgroup@smc.vnet.net
- Subject: [mg10454] Re: [mg10444] plot coloring
- From: Levasseur <levasseu@bit-net.com>
- Date: Fri, 16 Jan 1998 04:34:41 -0500
- References: <199801130707.CAA20940@smc.vnet.net.>
Paul.Hanson@colorado.edu wrote: > > Hola, all; > I'm looking for a way to color lines. Say I have a data set > {{{x,y},...{xn,yn}},{{x1,y1}....{xn1,yn1}},.....} and I want to plot > each of the points in the set with different colors. I've tried using > Map to change the values of r,g,b but they all change byt the same > amount, thus, the lines are always the same color. How do I vary r,g,b > selectively and uniquely so that I get different colors for each line? > If pts is a list of ordered pairs and colors is a list of GRBColor expressions of the same length, then with Transpose[{colors,Map[Point,pts]}]//Graphics//Show you should see what you're looking for Or if you want the lines of different color, try something like Transpose[{Rest[colors],Map[Point,Partition[pts,2,1]]}]//Graphics//Show (I'm using Rest here since Length[Partition[pts,2,1]] =Length[pts]-1 ) Ken Levasseur PS: Interested in a on-line course in Mathematica? Check out http://www.uml.edu/Dept/Math/m419.html a 3 credit UMass Lowell course that can be taken from anywhere in the world!
- References:
- plot coloring
- From: Paul.Hanson@colorado.edu
- plot coloring