perspPoints

0th

Percentile

Draw Points or Lines on a Surface Viewed in Perspective

After a surface has been plotted in a perspective view using persp.im, these functions can be used to draw points or lines on the surface.

Keywords
hplot, spatial
Usage
perspPoints(x, y=NULL, …, Z, M)

perspLines(x, y = NULL, …, Z, M)

perspSegments(x0, y0 = NULL, x1 = NULL, y1 = NULL, …, Z, M)

perspContour(Z, M, …, nlevels=10, levels=pretty(range(Z), nlevels))

Arguments
x,y

Spatial coordinates, acceptable to xy.coords, for the points or lines on the horizontal plane.

Z

Pixel image (object of class "im") specifying the surface heights.

M

Projection matrix returned from persp.im when Z was plotted.

Graphical arguments passed to points, lines or segments to control the drawing.

x0,y0,x1,y1

Spatial coordinates of the line segments, on the horizontal plane. Alternatively x0 can be a line segment pattern (object of class "psp") and y0,x1,y1 can be NULL.

nlevels

Number of contour levels

levels

Vector of heights of contours.

Details

After a surface has been plotted in a perspective view, these functions can be used to draw points or lines on the surface.

The user should already have called persp.im in the form M <- persp(Z, visible=TRUE, ...) to display the perspective view of the surface Z.

Only points and lines which are visible from the viewer's standpoint will be drawn.

Value

Same as the return value from points or segments.

See Also

persp.im

Aliases
  • perspPoints
  • perspSegments
  • perspLines
  • perspContour
Examples
# NOT RUN {
  M <- persp(bei.extra$elev, colmap=terrain.colors(128),
             apron=TRUE, theta=-30, phi=20,
             zlab="Elevation", main="", 
             expand=6, visible=TRUE, shade=0.3)

  perspContour(bei.extra$elev, M=M, col="pink", nlevels=12)
  perspPoints(bei, Z=bei.extra$elev, M=M, pch=16, cex=0.3, col="chartreuse")
# }
Documentation reproduced from package spatstat, version 1.59-0, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.