perspPoints | R Documentation |
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.
perspPoints(x, y=NULL, ..., Z, M, occluded=TRUE)
perspLines(x, y = NULL, ..., Z, M, occluded=TRUE)
perspSegments(x0, y0 = NULL, x1 = NULL, y1 = NULL, ..., Z, M, occluded=TRUE)
perspContour(Z, M, ...,
nlevels=10, levels=pretty(range(Z), nlevels),
occluded=TRUE)
x , y |
Spatial coordinates,
acceptable to |
Z |
Pixel image (object of class |
M |
Projection matrix returned from |
... |
Graphical arguments passed to
|
x0 , y0 , x1 , y1 |
Spatial coordinates of the line segments, on the
horizontal plane. Alternatively |
nlevels |
Number of contour levels |
levels |
Vector of heights of contours. |
occluded |
Logical value specifying whether parts of the surface can be obscured by other parts of the surface. See 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
to display the perspective view of the surface Z
and to obtain the perspective matrix M
by typing
M <- persp(Z, ...)
. The points and lines will be drawn in
their correct three-dimensional position according to the same
perspective.
If occluded=TRUE
(the default), then the surface is
treated as if it were opaque. The code will
draw only those points and lines which are visible
from the viewer's standpoint, and not obscured by other parts
of the surface lying closer to the viewer.
The user should already have called persp.im
in the form M <- persp(Z, visible=TRUE, ...)
to compute the visibility information.
If occluded=FALSE
, then the surface is treated
as if it were transparent.
All the specified points and lines will be drawn on the
surface.
Same as the return value from
points
or segments
.
persp.im
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.