|
[Date Index]
[Thread Index]
[Author Index]
Re: plot coloring
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!
Prev by Date:
Problem using PlotLegend
Next by Date:
Re: postscript file output problem [help]
Prev by thread:
plot coloring
Next by thread:
RE: plot coloring
|