[R] panel.abline() and trellis.focus() on multipage plots
Deepayan Sarkar
deepayan.sarkar at gmail.com
Thu Apr 13 22:50:42 CEST 2006
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
More information about the R-help
mailing list