Re: [R] adding a reference line to an xyplot

2009-02-20 Thread Philipp Pagel
On Fri, Feb 20, 2009 at 01:34:02AM -0800, Chris Bennett wrote: > I want to add a dashed vertical line to a number of xyplots. > > Here is a simple script of the type of plot I have but then I want to add a > reference line to 1995 on each of the panels. I have tried panel.abline and > other sugge

Re: [R] adding a reference line to an xyplot

2009-02-20 Thread baptiste auguie
Hi, try this: p <- xyplot(matter~year|plot,type="l") update(p, panel=function(...){ panel.xyplot(...) panel.abline(v=1995) } ) On 20 Feb 2009, at 09:34, Chris Bennett wrote: Hi, I want to add a dashed vertical line to a number of xyplots. Here is a simple script of the t

Re: [R] adding a reference line to an xyplot

2009-02-20 Thread baptiste auguie
Another approach using latticeExtra, more ggplot2-like: p <- xyplot(matter~year|plot,type="l") p + latticeExtra::layer(panel.abline(v=1995)) On 20 Feb 2009, at 09:34, Chris Bennett wrote: Hi, I want to add a dashed vertical line to a number of xyplots. Here is a simple script of the typ

[R] adding a reference line to an xyplot

2009-02-20 Thread Chris Bennett
Hi, I want to add a dashed vertical line to a number of xyplots. Here is a simple script of the type of plot I have but then I want to add a reference line to 1995 on each of the panels. I have tried panel.abline and other suggestions on the forum but can't get it to work. plot<-rep(letters[1