hi R gurus I saw some graphs with vertical band like this one: http://pragcap.com/wp-content/uploads/2010/04/GS.png how to draw the blue band in R, can't find any clue to do this,any ideas? thanks in advance [[alternative HTML version deleted]]
?rect On Wed, Apr 14, 2010 at 10:36 AM, senne <wasenne@gmail.com> wrote:> hi R gurus > > I saw some graphs with vertical band like this one: > > http://pragcap.com/wp-content/uploads/2010/04/GS.png > > how to draw the blue band in R, can't find any clue to do this,any ideas? > > thanks in advance > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]]
There is panel.xblocks() in the latticeExtra package: http://latticeextra.r-forge.r-project.org/#panel.xblocks and a corresponding base graphics function xblocks() in the development version of the zoo package (not in the current CRAN release). On 15 April 2010 00:36, senne <wasenne at gmail.com> wrote:> hi R gurus > > I saw some graphs with vertical band like this one: > > http://pragcap.com/wp-content/uploads/2010/04/GS.png > > how to draw the blue band in R, can't find any clue to do this,any ideas? > > thanks in advance > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > 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. >-- Felix Andrews / ??? Postdoctoral Fellow Integrated Catchment Assessment and Management (iCAM) Centre Fenner School of Environment and Society [Bldg 48a] The Australian National University Canberra ACT 0200 Australia M: +61 410 400 963 T: + 61 2 6125 4670 E: felix.andrews at anu.edu.au CRICOS Provider No. 00120C -- http://www.neurofractal.org/felix/
On 04/15/2010 12:36 AM, senne wrote:> hi R gurus > > I saw some graphs with vertical band like this one: > > http://pragcap.com/wp-content/uploads/2010/04/GS.png > > how to draw the blue band in R, can't find any clue to do this,any ideas? >Hi senne, The rect function in base graphics can do the job. First do the plot with type="n" (i.e. no plotting), then display your rectangles: xylim<-par("usr") rect.left<-as.Date(seq(paste(rep(c("Dec","Mar","Jun","Sep"),length.out=10), c("07","08","08","08","08","09","09","09","09","10"),sep="-"))) rect.right<-rect.left+10 rect(rect.left,xylim[3],rect.right,xylim[4],col="lightblue",border="lightblue") then draw the line and text labels. Warning - untested Jim
On 04/15/2010 12:36 AM, senne wrote:> > hi R gurus > > > > I saw some graphs with vertical band like this one: > > > > http://pragcap.com/wp-content/uploads/2010/04/GS.png > > > > how to draw the blue band in R, can't find any clue to do this,any ideas? >See the source code for nber.xy and nberShade.ggplot in the "tis" package by Jeff Hallman. They both do what you want. I'm working on something similar. Besides drawing the bands, my version will also vary heights optionally (rather than have bands stretching the entire height of the graph) and use ggplot2. Marsh Feldman