On 2/29/08, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> See share/perl/massage-examples.pl
>
>  Hint: lattice is a (very sophisticated) wrapper for grid, and it is
>  grid.newpage() that has the hook.
>
>  Hint 2: look at the version in the R-devel sources,
>
>  https://svn.r-project.org/R/trunk/share/perl/massage-Examples.pl
>
>  for use with lattice.
>
>
>  On Fri, 29 Feb 2008, Jim Price wrote:
>
>  >
>  > Hi,
>  >
>  > I am trying to find a way to automate production of page numbers in plots
>  > produced using the lattice package. To do this, I started playing around
>  > with setHook which works fine with vanilla plot, but the hook 'plot.new'
>  > doesn't appear to be relevant to the lattice package. I was wondering if
>  > there is a alternative someone can suggest for use with the lattice 
> package.

Another solution is to use the 'page' argument. It takes its default from
lattice.getOption("default.args")$page, so you could set something like

lattice.options(default.args = list(page = function(n) {
    panel.text(lab = sprintf("Page %d", n), x = 0.95, y = 0.05)
}))

This would put page numbers starting from 1 for each plot, but you
could easily use a global counter instead.

-Deepayan

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to