Skip to content
Prev 97041 / 398500 Next

placing rectangle behind plot

Thanks.  That's helpful.

I would be interested in the case where

1. one does not have a variable latticeplot, as per your example,
but just has the output of

   xyplot(x ~ x | gl(2,1), layout = 1:2)

sitting on the screen, having been "printed" by a prior
function.  We can assume that no other graphics have been
issued since then. Can one still create a grey rectangle behind
the lower panel?

2. In fact, ideally what I would like is to create a function,
put.in.bg, say, that works something like this:

   xyplot(x ~ x | gl(2,1), layout = 1:2)
   trellis.focus("panel", 1, 1)
   put.in.bg(grid.rect(w = 0.5))
   trellis.unfocus()

or maybe

   xyplot(x ~ x | gl(2,1), layout = 1:2)
   trellis.focus.bg("panel", 1, 1)
   grid.rect(w = 0.5)
   trellis.unfocus()

That allows one to add objects to a lattice panel behind the objects
that are already there. This would also be helpful for adding grid
lines afterwards or other lines, rectangles, etc.
On 7/30/06, Paul Murrell <p.murrell at auckland.ac.nz> wrote: