Sara-Jane Dunn a écrit :

> I need to know if there is any way of using different colours for
> different intervals of a line on a graph. Eg. If I plot the line y=x for
> x=1:10, and split this line into 106 intervals (i.e. not a 'nice' number
> of intervals) how could I colour different intervals different colours
> without having to use segments and specify coordinates to join?
> Thanks in advance for any help!
> Sara-Jane

I think you'll have to use segments (?lines())
but it shouldn't be too complicated.

Put your line begin, line end, line color in a matrix(, ncol=106)
and call lines(...) in a for loop.

I would be happy to hear about another way to do it ?

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to