[R] continuous shading in plots

Jim Lemon jim at bitwrit.com.au
Tue Feb 19 00:30:30 CET 2013


On 02/19/2013 09:50 AM, Jim Lemon wrote:
> Hi Elisabeth,
> For a quick hack, try this:
>
> segments(rep(0,100),seq(-4.5,0,length.out=200),rep(14,200),
> seq(0,4.5,length.out=200),
> col=rgb(seq(0.8,0.5,length.out=200),seq(0.8,0.5,length.out=200),
> seq(0.8,0.5,length.out=200)),lwd=2)
>
and even easier:

library(plotrix)
segments(rep(0,100),seq(-4.5,0,length.out=200),rep(14,200),
  seq(0,4.5,length.out=200),col=smoothColors("white",198,"darkgray"))

Jim



More information about the R-help mailing list