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]]
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
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
Possibly Parallel Threads
- Plotting log-axis with the exponential base to a plot with the default logarithm base 10
- [Fwd: Re: Plotting log-axis with the exponential base to a plot with the default logarithm base 10]
- Plotting log-axis with the exponential base to a plot wi
- Solaris 8, Can't find recent OpenSSL libcrypto
- DierckxSpline fitting with different sets of y-values in one time