Create List of Plotting Layers

Given several objects which are capable of being plotted, create a list containing these objects as if they were successive layers of a plot. The list can then be plotted in different ways.

hplot, spatial
layered(..., plotargs = NULL)
Objects which can be plotted by plot.
Default values of the plotting arguments for each of the objects. A list of lists of arguments of the form name=value.

Layering is a simple mechanism for controlling a high-level plot that is composed of several successive plots, for example, a background and a foreground plot. The layering mechanism makes it easier to issue the plot command, to switch on or off the plotting of each individual layer, and to control the plotting arguments that are passed to each layer. Each individual layer in the plot should be saved as an object that can be plotted using plot. It will typically belong to some class, which has a method for the generic function plot.

The command layered simply saves the objects ... as a list of class "layered". This list can then be plotted by the method plot.layered. Thus, you only need to type a single plot command to produce the multi-layered plot. Individual layers of the plot can be switched on or off, or manipulated, using arguments to plot.layered. The argument plotargs contains default values of the plotting arguments for each layer. It should be a list, with one entry for each object in .... Each entry of plotargs should be a list of arguments in the form name=value, which are recognised by the plot method for the relevant layer.


  • A list, belonging to the class "layered".

See Also


  • layered
   D <- distmap(cells)
   L <- layered(D, cells)
   L <- layered(D, cells,
    plotargs=list(list(ribbon=FALSE), list(pch=16)))
Documentation reproduced from package spatstat, version 1.25-5, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.