plot.sp2: Plot a Point Pattern on the Sphere

View source: R/plotting.R

plot.sp2R Documentation

Plot a Point Pattern on the Sphere

Description

Plot a point pattern on the sphere, and its window of observation.

Usage

 ## S3 method for class 'sp2'
plot(x, ..., eye, top, add = FALSE)

 ## S3 method for class 'sp3'
plot(x, ..., eye, top, add = FALSE)

Arguments

x

Point pattern on the sphere (object of class "sp2" or "sp3").

...

Graphical parameters passed to lower-level plot functions.

eye

Spatial position of the viewer. Either a numeric vector of length 2 (interpreted as giving colatitude and longitude respectively in radians), or a numeric vector of length 3 (interpreted as the three-dimensional Cartesian coordinates) or a list with entries lon and lat giving longitude and latitude coordinates in degrees.

top

Location on the sphere that should be at the top of the plot. Same format as eye. Defaults to the North Pole.

add

Logical value indicating whether to add the points to an existing spherical plot. This will only work correctly if the same values of eye and top are used in both plots.

Details

Only points that are visible from the eye position are plotted (i.e. all points x for which d(x,eye) <= pi*rho/2, where rho is the radius of the sphere). That is, points on the other side of the sphere are not displayed (i.e. all points y for which d(x,eye) > pi*rho/2).

Value

Null.

Author(s)

Adrian Baddeley.

See Also

plot.sphwin for plotting the window only.

sp2, sp3

Examples

  sphcap <- sphwin(type="band", param=c(0, pi/3), ref=c(pi/8,pi/6))
  X <- runif.sphwin(n=150, win=sphcap, as.sp=TRUE, ndim="2")
  plot(X)

  plot(X$win, col="pink")
  plot(X, add=TRUE, pch=".", cex=4, col="blue")

baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.