| plot.ppp {spatstat} | R Documentation |
Plot a two-dimensional spatial point pattern
plot.ppp(x, main, ..., chars, use.marks=TRUE, add=FALSE)
x |
The spatial point pattern to be plotted.
An object of class "ppp",
or data which can be converted into
this format by as.ppp().
|
main |
text to be displayed as a title above the plot. |
... |
extra arguments passed to the generic plot function.
|
chars |
the plotting characters which should be used to represent the points with different marks. See below. |
use.marks |
logical flag; if TRUE, plot points using a different
plotting symbol for each mark;
if FALSE, only the locations of the points will be plotted,
using points().
|
add |
logical flag; if TRUE,
just the points are plotted, over the existing plot.
A new plot is not created, and
the window is not plotted.
|
This is the plot method for the class "ppp"
(see ppp.object for details of this class).
It invokes plot.owin to display the observation window
x$window.
Then the locations of the points are
plotted using points().
If the points do not have marks (i.e. x$marks is absent)
or if use.marks = FALSE,
then the locations of the points will be plotted
using a single plot character. This character can be changed
by the extra argument pch; see the examples.
If the points have marks, then each mark value will be
represented by a different plot character. This action can be overridden
by setting use.marks = FALSE.
For marked point patterns the default
is to represent the ith unique mark value by
points(..., pch=i).
If the vector chars is supplied, it should have the same length
as sort(unique(x$marks)), and then the ith smallest mark
will be plotted using points(..., pch=chars[i]).
NULL, or a vector giving the correspondence between
mark values and plotting characters.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
ppp.object,
plot,
points,
plot.owin
library(spatstat) data(cells) plot(cells) # multitype data(lansing) plot(lansing) # marked by a real number data(longleaf) plot(longleaf) # just plot the points plot(longleaf, use.marks=F) plot(unmark(longleaf)) # equivalent # use selected plot characters lma <- sort(unique(longleaf$marks)) adult <- ifelse(lma >= 30, "o", "+") plot(longleaf, chars = adult)