| layer3D.axes {ivue} | R Documentation |
Coordinate Axes Through an Origin
Description
Add three coordinate axes with positive-end arrowheads, rather than a
bounding box. Use axes = FALSE in the plotting call to suppress its ordinary
axes. This layer never changes the camera; camera.zup() supplies a
complementary initial view.
Usage
layer3D.axes(
origin = c(0, 0, 0),
limits = NULL,
padding = 0.2,
labels = c("x", "y", "z"),
col = "black",
width = 2,
head.length = 0.04,
head.angle = pi/8,
cex = 1.2,
label.offset = 0.04
)
Arguments
origin |
Three finite coordinates at which the axes intersect. |
limits |
NULL for automatic limits, or a finite numeric 3-by-2 matrix with rows x, y, z and columns lower, upper. Each row must strictly contain the corresponding origin coordinate. Row and column names are optional. |
padding |
Nonnegative fraction added to automatic half-lengths. Ignored when limits are supplied. |
labels |
Three axis labels. Empty strings suppress individual labels. |
col |
Axis colors, length one or three, also used for heads and labels. |
width |
Positive shaft line widths, length one or three, in screen units. |
head.length |
Arrowhead length as a fraction of each full axis span, from 0 to 0.25. Zero omits heads. Length is capped at 80 percent of the positive arm to keep the head beyond the origin. |
head.angle |
Cone half-angle in radians, strictly between 0 and pi/2. |
cex |
Positive label size multiplier. |
label.offset |
Nonnegative gap beyond each positive tip, as a fraction of that axis's full span. |
Details
Automatic limits are symmetric about origin and enclose all rows of X. A coordinate with no extent uses the largest other half-length, or one data unit if all points coincide with origin. Arrowheads are solid cones in data coordinates, not screen-facing decorations, so they rotate with the scene. Their proportions assume aspect = "equal"; independently normalizing coordinate axes can distort them. Limits specify axis endpoints, not clipping bounds for the data. There are no tick marks.
Value
An ivue_layer specification for the layers argument.
See Also
camera.zup(), layer3D.edges(), plot3D.cont()
Examples
axes <- layer3D.axes(head.length = 0.04)
if (nzchar(system.file(package = "rgl"))) {
X <- rbind(c(-1, -1, 0), c(1, 0, 1), c(0, 1, -1))
w <- plot3D.plain(X, axes = FALSE, layers = list(axes),
camera = camera.zup())
}