This is the plot
method for
point pattern datasets (of class "ppp"
, see ppp.object
). First the observation window Window(x)
is plotted
(if show.window=TRUE
).
Then the points themselves are plotted,
in a fashion that depends on their marks,
as follows.
- unmarked point pattern:
-
If the point pattern does not have marks, or if
use.marks = FALSE
,
then the locations of all points will be plotted
using a single plot character
multitype point pattern:
If x$marks
is a factor, then
each level of the factor is
represented by a different plot character.
continuous marks:
If x$marks
is a numeric vector,
the marks are rescaled to the unit interval and
each point is represented by a circle
with diameter proportional to the rescaled mark
(if the value is positive) or a square with side length
proportional to the absolute value of the rescaled mark
(if the value is negative).
other kinds of marks:
If x$marks
is neither numeric nor a factor,
then each possible mark will be represented by a
different plotting character. The default is to
represent the $i$th smallest mark value by
points(..., pch=i)
.
If there are several columns of marks, and if which.marks
is
missing or NULL
, then
-
if
add=FALSE
and multiplot=TRUE
the default is to plot all columns of marks, in a series of separate
plots, placed side-by-side. The plotting is coordinated by
plot.listof
, which calls plot.ppp
to make each of
the individual plots.
-
Otherwise, only one column of marks can be plotted,
and the default is
which.marks=1
indicating the first column of marks.
Plotting of the window Window(x)
is performed by
plot.owin
. This plot may be modified
through the ...
arguments. In particular the
extra argument border
determines
the colour of the window, if the window is not a binary mask.
Plotting of the points themselves is performed
by the function points
, except for the case of
continuous marks, where it is performed by symbols
.
Their plotting behaviour may be modified through the ...
arguments.
The argument chars
determines the plotting character
or characters used to display the points (in all cases except
for the case of continuous marks). For an unmarked point pattern,
this should be a single integer or character determining a
plotting character (see par("pch")
).
For a multitype point pattern, chars
should be a vector
of integers or characters, of the same length
as levels(x$marks)
, and then the $i$th level or type
will be plotted using character chars[i]
.
If chars
is absent, but there is an extra argument
pch
, then this will determine the plotting character for
all points.
The argument cols
determines the colour or colours used to
display the points. For an unmarked point pattern,
cols
should be a character string
determining a colour. For a multitype point pattern, cols
should be a character vector, of the same length
as levels(marks(x))
: that is, there is one colour for each
possible mark value. The $i$th level or type will
be plotted using colour cols[i]
. For a point pattern with
continuous marks, cols
can be either a character string
or a character vector specifying colour values: the range of mark
values will be mapped to the specified colours.
If cols
is absent, the colours used to plot the
points may be determined by the extra argument fg
(for multitype point patterns) or the extra argument col
(for all other cases). Note that specifying col
will also
apply this colour to the window itself.
The default colour for the points is a semi-transparent grey,
if this is supported by the plot device. This behaviour can be
suppressed (so that the default colour is non-transparent)
by setting spatstat.options(transparent=FALSE)
.
The arguments maxsize
, meansize
and markscale
incompatible. They control the physical size of the circles and
squares which represent the marks in a point pattern with continuous
marks. The size of a circle is defined as its diameter;
the size of a square is its side length.
If markscale
is given, then a mark value of m
is plotted as a circle of diameter m * markscale
(if m
is positive) or a square of side abs(m) * markscale
(if m
is negative). If maxsize
is given, then the
largest mark in absolute value, mmax=max(abs(marks(x)))
,
will be scaled to have physical size maxsize
.
If meansize
is given, then the
average absolute mark value, mmean=mean(abs(marks(x)))
,
will be scaled to have physical size meansize
.
The user can set the default values of these plotting parameters
using spatstat.options("par.points")
.
To zoom in (to view only a subset of the point pattern at higher
magnification), use the graphical arguments
xlim
and ylim
to specify the rectangular field of view.
The value returned by this plot function is an object of
class "symbolmap"
representing the mapping from mark values
to graphical symbols. See symbolmap
.
It can be used to make a suitable legend,
or to ensure that two plots use the same graphics map.