[R] Transparent Bands in R

Jim Lemon jim at bitwrit.com.au
Wed Oct 21 11:15:33 CEST 2009


On 10/21/2009 09:40 AM, mnstn wrote:
> Hello All,
>> My question is regarding the attached plot. I would like to have multiple
>> transparent green bands running the length (yaxis) of the plot the width of
>> which is determined by the green lines at y=0 in the plot. Can you suggest a
>> way to do it?
>>      
Hi mnstn,
Transparency is only supported by some graphic devices. It may be 
simpler to plot the values, use "rect" to draw green rectangles:

xylim<-par("usr")
rect(start1,xylim[3],stop2,xylim[4],col="green")
rect(start2,...

then redraw the lines over the rectangles using "lines".

Jim




More information about the R-help mailing list