## S3 method for class 'listof':
plot(x, \dots, main, arrange=TRUE,
nrows=NULL, ncols=NULL, main.panel=NULL, mar.panel=c(2,1,1,2),
panel.begin=NULL, panel.end=NULL, panel.args=NULL, plotcommand="plot",
adorn.left=NULL, adorn.right=NULL, adorn.top=NULL, adorn.bottom=NULL,
adorn.size=0.2, equal.scales=FALSE)
"listof"
.
Essentially a list of objects.plot
when generating each
plot panel.arrange=TRUE
)
or plot them individually in a succession of frames
(arrange=FALSE
).arrange=TRUE
).
You can specify either or both of these numbers.mar
controlling the size
of the margins outside each plot panel.
See the help file for par
.equal.scales=FALSE
and increase the values of mar.panel
.plot
method for the class "listof"
. An object of class "listof"
(defined in the base R package) represents
a list of objects, all belonging to a common class.
The base R package defines a method for printing these objects,
print.listof
, but does not define a method for plot
.
So here we have provided a method for plot
.
In the "listof"
, essentially a list of
spatial objects of the same kind.
These objects can be plotted in a nice arrangement
using plot.listof
. See the Examples.
The arguments panel.begin
and panel.end
may be functions that will be executed before and after each panel is plotted.
They will be called as panel.begin(i, y, main=main.panel[i])
and panel.end(i, y, add=TRUE)
.
Alternatively, panel.begin
and panel.end
may be objects
of some class that can be plotted
with the generic plot
command. They will be plotted before and
after each panel is plotted.
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:
print.listof
,
contour.listof
,
image.listof
,
density.splitppp
# Multitype point pattern
data(amacrine)
plot(D <- density(split(amacrine)))
plot(D, main="", equal.ribbon=TRUE,
panel.end=function(i,y,...){contour(y, ...)})
Run the code above in your browser using DataLab