Learn R Programming

ads (version 1.4)

plot.spp: Plot a Spatial Point Pattern object

Description

Plot a Spatial Point Pattern object returned by function spp.

Usage

## S3 method for class 'spp':
plot(x, main, out=FALSE, use.marks=TRUE, cols, chars, cols.out, chars.out,
maxsize, scale=TRUE, add=FALSE, legend=TRUE, csize=1, ...)

Arguments

x
an object of class "spp" (see spp).
main
by default, the value of argument x, otherwise a text to be displayed as a title of the plot.main=NULL displays no title.
out
by default out = FALSE. If TRUE points of the pattern located outside the sampling window are plotted.
use.marks
by default use.marks = TRUE. If FALSE different symbols are not used for each mark of multivariate or marked point patterns, so that they are plotted as univariate (see spp).
cols
(optional) the coulour(s) used to plot points located inside the sampling window (see Details).
chars
(optional) plotting character(s) used to plot points located inside the sampling window (see Details).
cols.out
(optional) if out = TRUE, the coulour(s) used to plot points located outside the sampling window (see Details).
chars.out
(optional) if out = TRUE, plotting character(s) used to plot points located outside the sampling window (see Details).
maxsize
(optional) maximum size of plotting symbols. By default maxsize is automatically adjusted to plot size.
csize
scaling factor for font size so that actual font size is par("cex")*csize. By default csize = 1.
scale
If scale = TRUE (the default) graduations giving plot size are displayed.
legend
If legend = TRUE (the default) a legend for plot symbols is displayed (multivariate and marked types only).
add
by default add = FALSE. If TRUE a new window is not created and just the points are plotted over the existing plot.
...
extra arguments that will be passed to the plotting functions plot.default, points and/or symbols.

Value

  • none.

encoding

latin1

Details

The sampling window x$window is plotted first, through a call to function plot.swin. Then the points themselves are plotted, in a fashion that depends on the type of spatial point pattern (see spp).
  • univariate pattern:ifx$type = c("univariate"), i.e. the point pattern does not have marks, or ifuse.marks = FALSE, then the locations of all points is plotted using a single plot character.
  • multivariate pattern:ifx$type = c("multivariate"), i.e. the marks are levels of a factor, then each level is represented by a different plot character.
  • marked pattern:ifx$type = c("marked"), i.e. the marks are real numbers, then points are represented by circles (argumentchars = "circles", the default) or squares (argumentchars = "squares") proportional to their marks' value (positive values are filled, while negative values are unfilled).
Arguments cols and cols.out (if out = TRUE) determine the colour(s) used to display the points located inside and outside the sampling window, respectively. Colours may be specified as codes or colour names (see par("col")). For univariate and marked point patterns, cols and cols.out are single character strings, while for multivariate point patterns they are charcater vectors of same length as levels(x$marks) and levels(x$marksout), respectively.

Arguments chars and chars.out (if out = TRUE) determine the symbol(s) used to display the points located inside and outside the sampling window, respectively. Symbols may be specified as codes or character strings (see par("pch")). For univariate point patterns, chars and chars.out are single character strings, while for multivariate point patterns they are charcater vectors of same length as levels(x$marks) and levels(x$marksout), respectively. For marked point patterns, chars and chars.out can only take the value "circles" or "squares".

See Also

spp, swin, plot.swin.

Examples

Run this code
data(BPoirier)
  BP<-BPoirier
  
  # a univariate point pattern in a rectangle sampling window
  plot(spp(BP$trees, win=BP$rect))
  
 # a univariate point pattern in a circular sampling window
 #with all points and graduations displayed
 plot(spp(BP$trees, win=c(55,45,45)), out=TRUE, scale=TRUE)
 
 # a univariate point pattern in a complex sampling window
 #with points outside the sampling window displayed (in red colour)
 plot(spp(BP$trees, win=BP$rect, tri=BP$tri1), out=TRUE)
  
 # a multivariate point pattern in a rectangle sampling window
 plot(spp(BP$trees, win=BP$rect, marks=BP$species))
 
 # a multivariate point pattern in a circular sampling window
 #with all points inside the sampling window displayed in blue colour
 #and all points outside displayed with the symbol "+" in red colour
 plot(spp(BP$trees, win=c(55,45,45), marks=BP$species), out=TRUE, cols=c("blue","blue","blue"), 
 chars.out=c("+","+","+"), cols.out=c("red","red","red"))
 
 # a marked point pattern in a rectangle sampling window
 #with circles in green colour
  plot(spp(BP$trees, win=BP$rect, marks=BP$dbh), cols="green")

 # a marked point pattern in a circular sampling window
 #with squares in red colour inside and circles in blue colour outside
  plot(spp(BP$trees, win=c(55,45,45), marks=BP$dbh), out=TRUE, chars="squares", 
  cols="red", cols.out="blue")

Run the code above in your browser using DataLab