text3d {R.basic}R Documentation

Adding text to a three dimensional plot

Description

Adding text to a three dimensional plot previously created by plot3d() or persp().

Usage

  text3d(x=seq(0, 1, len=nrow(z)), y=seq(0, 1, len=ncol(z)),
  z, labels=seq(along=x), persp.matrix=getOption("persp.matrix"),
  font=NULL, cex=1, col=NULL, ...)

Arguments

x the coordinates of text in the plot. Alternatively, a single plotting structure, function or any R object with a plot method can be provided.
y the y coordinates of text in the plot, optional if x is an appropriate structure.
z the z coordinates of text in the plot, optional if x is an appropriate structure.
labels the labels to be printed in the plot.
persp.matrix an 4-by-4 transformation matrix describing how to project the (x,y,z) text to the drawing canvas as the one returned by persp()
cex the character expansion of the data text. Default value is par(NULL).
col the color of the data text. Default value is par(NULL).
font the font to be used. For more information see text(). Default value is par(NULL).
... further arguments accepted by text().

Author(s)

Henrik Bengtsson, http://www.braju.com/R/

See Also

For creating a 3D plot see plot3d. For adding points to a 3D plot see points3d. For adding lines to a 3D plot see lines3d. For adding polygons to a 3D plot see polygon3d. For adding stems to a 3D plot see stem3d. See also persp. Package scatterplot3d by Uwe Ligges. For detail about the graphical parameter arguments, see par.

Examples

omega <- seq(0, 6*pi, length.out=1000)
x <- sin(omega); y <- cos(omega)
col <- hsv(omega/max(omega), 1,1)
plot3d(x,y,omega, pch=176, col=col)
o <- seq(1, length(x), by=20)
text3d(x[o],y[o],omega[o], col=rev(col[o]))

[Package Contents]