Re: [R] colour code areas of a plot

2013-10-22 Thread Olivier Crouzet
On Tue, 22 Oct 2013 16:43:18 +0200 Martin Batholdy wrote: Hi, you should replace your "color names" by calls to the rgb() function in order to generate the adequate colors, something like: bg_colors <- c(rep (rgb (0,1,0),20), rep (rgb (0,1,1),10), rep (rgb (0,1,0),20), rep(rgb (1,0,0),5), rep(r

Re: [R] colour code areas of a plot

2013-10-22 Thread Ken Knoblauch
Martin Batholdy googlemail.com> writes: > I would like to colour different areas of a plot. > But I don't know how to do this efficiently. > > here an example: > (t = time) > > t <- 1:100 > bg_colors <- c(rep('green',20), rep('yellow',10), rep('green',20), rep('red',5), > rep('yellow',45)) >