Message-ID: <5122B023.3070808@bitwrit.com.au>
Date: 2013-02-18T22:50:11Z
From: Jim Lemon
Subject: continuous shading in plots
In-Reply-To: <BAY173-W46E654D4FD33DF08E0CA79D9F40@phx.gbl>
On 02/19/2013 01:20 AM, Elisabeth wever wrote:
>
>
>
>
> Hi, Can someone help me with the following? I currently have the following plot: plot(c(0,14,0,14),c(0,5,0,5),ann = FALSE, xaxs="i", yaxs="i",bty="L" )
> polygon(c(0,18,18), c(0,6,0), col='light grey', border = NA)
> polygon(c(0,18,18), c(0,2,0), col='grey', border = NA) However, I would like to make such a plot, but where there is a continuous shading changing fom white to darkgrey. Can anyone give me any suggsetions how to do this in R? Thank you, Elisabeth
> [[alternative HTML version deleted]]
>
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)
Jim