Re: [R] lines() and recycled colours

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Tue 28 Feb 2006 - 20:55:12 EST


Hi

not sure as I do not know actual syntax, but seems to me that in type=h there segments are drawn from x axis to x,y values, hence the recycling behaviour has some sense.

In other types I wonder if it was really useful to have each segment of a line painted by different colour. If this is a case why not use segments() directly?

And probably the same applies to lwd, where it would be also strange if each segment was different line width?

HTH
Petr

On 28 Feb 2006 at 9:31, Robin Hankin wrote:

To:             	RHelp <r-help@stat.math.ethz.ch>
From:           	Robin Hankin <r.hankin@noc.soton.ac.uk>
Date sent:      	Tue, 28 Feb 2006 09:31:29 +0000
Subject:        	[R] lines() and recycled colours

> Hi
>
> ?lines says
>
>
> For 'type = "h"', 'col' can be a vector and will be recycled as
> needed.
>
>
> Why doesn't lines() recycle colours for other types?
>
> If I type
>
>
> > plot(0:1,0:1,type="n")
> > lines(runif(11),runif(11),col=c("red","green"))
> >
>
>
> then all ten lines are red, with no warning given. Is there a reason
> why colour recycling would be a bad idea in this case?
> Also, it would be nice if arguments such as lwd
> were recycled if needed too.
>
>
>
>
> --
> Robin Hankin
> Uncertainty Analyst
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
> tel 023-8059-7743
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal@precheza.cz



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Feb 28 21:07:54 2006

This archive was generated by hypermail 2.1.8 : Wed 01 Mar 2006 - 00:08:42 EST