When lattice.on
is TRUE
, the print.trellis
function,
which is typically called implicitly to create lattice plots, will trigger
playwith
, passing the original high-level call.
So for lattice plots only, this is like changing your default plot device.
It only replaces the screen device: plotting to a file device will work as normal.
This feature requires lattice
package version 0.17-1
or later. When base.on
is TRUE
, any new base graphics plot will trigger
playwith
(via a hook in plot.new
), and the high-level
plot call is taken to be the first call (to a named function) on the call stack.
The usual base graphics paradigm of building up a plot incrementally will not work well,
because only the initial plot call is recorded, so any further additions will be lost when the plot is redrawn.
For similar reasons, multiple-figure plots may not be redrawn correctly.
The high-level plot will be called twice initially, due to constraints of the mechanism.
The grid.on
argument is analogous to base.on
for grid graphics,
using a hook in grid.newpage
.
Note that this automatic behaviour is not a full replacement for calling
playwith
directly, since it does not allow to you specify any of the
optional arguments.
Another possibility is options(device="playwith")
.
This will act as a default device but without most of the
interactive features. The plot can still be annotated with text and
arrows in this case.