Learn R Programming

spatstat.geom (version 3.6-0)

plot.anylist: Plot a List of Things

Description

Plots a list of things

Usage

# S3 method for anylist
plot(x, ..., main, arrange=TRUE,
   nrows=NULL, ncols=NULL, main.panel=NULL,
   mar.panel=c(2,1,1,2), hsep=0, vsep=0,
   panel.begin=NULL, panel.end=NULL, panel.args=NULL,
   panel.begin.args=NULL, panel.end.args=NULL, panel.vpad=0.2,
   plotcommand="plot",
   adorn.left=NULL, adorn.right=NULL, adorn.top=NULL, adorn.bottom=NULL,
   adorn.size=0.2, adorn.args=list(),
   equal.scales=FALSE, halign=FALSE, valign=FALSE)

Arguments

Value

Null.

Details

This is the plot method for the class "anylist".

An object of class "anylist" represents a list of objects intended to be treated in the same way. This is the method for plot.

In the spatstat package, various functions produce an object of class "anylist", essentially a list of objects of the same kind. These objects can be plotted in a nice arrangement using plot.anylist. See the Examples.

The argument panel.args determines extra graphics parameters for each panel. It should be a function that will be called as panel.args(i) where i is the panel number. Its return value should be a list of graphics parameters that can be passed to the relevant plot method. These parameters override any parameters specified in the ... arguments.

The arguments panel.begin and panel.end determine graphics that will be plotted before and after each panel is plotted. They may be objects of some class that can be plotted with the generic plot command. Alternatively they may be functions that will be called as panel.begin(i, y, main=main.panel[i]) and panel.end(i, y, add=TRUE) where i is the panel number and y = x[[i]].

If all entries of x are pixel images, the function image.listof is called to control the plotting. The arguments equal.ribbon and col can be used to determine the colour map or maps applied.

If equal.scales=FALSE (the default), then the plot panels will have equal height on the plot device (unless there is only one column of panels, in which case they will have equal width on the plot device). This means that the objects are plotted at different physical scales, by default.

If equal.scales=TRUE, then the dimensions of the plot panels on the plot device will be proportional to the spatial dimensions of the corresponding components of x. This means that the objects will be plotted at approximately equal physical scales. If these objects have very different spatial sizes, the plot command could fail (when it tries to plot the smaller objects at a tiny scale), with an error message that the figure margins are too large.

The objects will be plotted at exactly equal physical scales, and exactly aligned on the device, under the following conditions:

  • every component of x is a spatial object whose position can be shifted by shift;

  • panel.begin and panel.end are either NULL or they are spatial objects whose position can be shifted by shift;

  • adorn.left, adorn.right, adorn.top and adorn.bottom are all NULL.

Another special case is when every component of x is an object of class "fv" representing a function. If equal.scales=TRUE then all these functions will be plotted with the same axis scales (i.e. with the same xlim and the same ylim).

See Also

contour.listof, image.listof, density.splitppp

Examples

Run this code
if(require(spatstat.explore)) {
 trichotomy <- list(regular=cells,
                    random=japanesepines,
                    clustered=redwood)
 K <- lapply(trichotomy, Kest)
 K <- as.anylist(K)
 plot(K, main="")
}

# list of 3D point patterns
 ape1 <- osteo[osteo$shortid==4, "pts", drop=TRUE]
 class(ape1)
 plot(ape1, main.panel="", mar.panel=0.1, hsep=0.7, vsep=1,
      cex=1.5, pch=21, bg='white')

Run the code above in your browser using DataLab