vincent david
2006-Apr-13 09:53 UTC
[R] panel.abline() and trellis.focus() on multipage plots
Hi, I'm recently working on a multipage bwplot() using the lattice package. In this context I was trying to use the panel.abline() function individually on certain panels but not all. After some research I found the trellis.focus() and trellis.unfocus() functions which enabled me to do something like: trellis.focus("panel", 1, 3) do.call("panel.abline", list (c(0.5, 0), col="tomato", lty=2 )) trellis.unfocus() The result is quite what I expected and working properly as long I'm having a one-page plot. It happens quite frequently though, that I'm operating with multipage plots. In this case I'm only able to manipulate the panels of the last page which I find quite unfortunate. So here's my question now: Is there any chance of using trellis methods to solve this problem or is it necessary to dive into the deep realms of the grid package do this? Would it make any difference if I pass the result of my bwplot() call to a trellis object and manipulate this before plotting? with kind regards Vincent [[alternative HTML version deleted]]
Deepayan Sarkar
2006-Apr-13 20:50 UTC
[R] panel.abline() and trellis.focus() on multipage plots
On 4/13/06, vincent david <vega42 at googlemail.com> wrote:> Hi, > > I'm recently working on a multipage bwplot() using the lattice package. In > this context I was trying to use the panel.abline() function individually on > certain panels but not all. After some research I found the trellis.focus() > and trellis.unfocus() functions which enabled me to do something like: > > trellis.focus("panel", 1, 3) > do.call("panel.abline", list (c(0.5, 0), col="tomato", lty=2 )) > trellis.unfocus() > > The result is quite what I expected and working properly as long I'm having > a one-page plot. It happens quite frequently though, that I'm operating with > multipage plots. In this case I'm only able to manipulate the panels of the > last page which I find quite unfortunate. > > So here's my question now: > > Is there any chance of using trellis methods to solve this problem or is it > necessary to dive into the deep realms of the grid package do this? Would it > make any difference if I pass the result of my bwplot() call to a trellis > object and manipulate this before plotting?If the determination of which panels need this enhancement can be done algorithmically, you can code that into your panel function (the 'panel.number' argument can help). Trellis objects can be subsetted, so you can print one page at a time. Deepayan
Maybe Matching Threads
- Focus on a sub-panel of a splom with trellis.focs() -- return coordinate of sub-panel, or names of variables therein
- trellis.focus with postscript device
- Lattice trellis.focus() with pdf
- Call to trellis.focus(); thenpanel.superpose()
- Sweave and multipage lattice