Lattice graphics consist of one or more rectangular drawing areas called panels. The data assigned to each panel is referred to as a packet. Lattice functions work by calling one or more panel functions, which actually plot the packets within panels. To change the appearance of a plot, you can specify arguments to the plotting function or change the panel function.
Here is what typically happens in a lattice session:
The end user calls a high-level lattice plotting function.
examines the calling arguments and default parameters, assembles a
lattice object, and returns the object. (Note that the class of the
object is actually “trellis.” This means that many of the methods
that act on an object, like
plot, are named
The user calls
plot.lattice with the lattice object as an
argument. (This typically happens automatically on the R
sets up the matrix of panels, assigns packets to different panels
(specified by the argument
packet.panel) and then calls the panel
function specified in the lattice object to draw the individual
Lattice graphics are extremely modular; they share many high-level
low-level functions (like
panel.axis, which draws axes). This means that they share many common arguments. It also means that you can customize the appearance of lattice graphics by creating substitute ...