Re: [R] plotting many line segments in different colors

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Sat 03 Jul 2004 - 07:44:02 EST

rif <rif@MIT.EDU> writes:

> I want to plot a large number of line segments, with a color
> associated with each line segment
[snip]
> Is there a function that does what I want? Right now I'm using the
> obvious solution of calling lines in a loop with a single segment, but
> this is really quite slow for my purposes, as I have several thousand
> lines total to plot.

I don't know how to break this to you, but....

Have you considered segments()?

> plot(1:10,1:10)
> segments(1:9,1:9,2:10,2:10,col=1:9,lwd=3)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sat Jul 03 07:48:27 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:40 EST