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? For those who can't or are unwilling to download the file the plot is at http://www.twitpic.com/ma8w0 Thanks! http://www.nabble.com/file/p25983169/foo.ps foo.ps -- View this message in context: http://www.nabble.com/Transparent-Bands-in-R-tp25983169p25983169.html Sent from the R help mailing list archive at Nabble.com.
Hi, Maybe use polygon() ? Good luck, Megha. 2009/10/20 mnstn <pavan.namd at gmail.com>:> > 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? > For those who can't or are unwilling to download the file the plot is at > http://www.twitpic.com/ma8w0 > > Thanks! > http://www.nabble.com/file/p25983169/foo.ps foo.ps > -- > View this message in context: http://www.nabble.com/Transparent-Bands-in-R-tp25983169p25983169.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
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
Hello Megha and Jim, Thanks for your comments. The green bands actually correspond to data that looks like: 13 0 42 0 183 0 186 0 187 0 192 0 194 0 and so on. I plotted them using: plot(v[,1],3+v[,2],type="h",col="gray",lwd=5) and the rest of the data using points. The result is here: http://www.twitpic.com/md2li Thanks! Jim Lemon-2 wrote:> > 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 > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >-- View this message in context: http://www.nabble.com/Transparent-Bands-in-R-tp25983169p25995374.html Sent from the R help mailing list archive at Nabble.com.
Reasonably Related Threads
- Help with calculating entropy of data
- ?to calculate sth for groups defined between points in one variable (string), / value separating/ spliting variable into groups by i.e. between start, NA, NA, stop1, start2, NA, stop2
- Creating missingness in repeated measurement data
- how to draw multiple vertical bands
- 2 KM curves on the same plot