rgl (version 0.67-2)

texts: add text

Description

Adds text to the scene. The text is positioned in 3D space. A bitmap font which is always oriented towards the camera is used.

Usage

rgl.texts(x, y = NULL, z = NULL, text, adj = 0.5, justify, ...)
text3d(x, y = NULL, z = NULL, texts, adj = 0.5, justify, ...) 
texts3d(x, y = NULL, z = NULL, texts, adj = 0.5, justify, ...)

Arguments

x, y, z
point coordinates. Any reasonable way of defining the coordinates is acceptable. See the function xyz.coords for details.
text
text character vector to draw
texts
text character vector to draw
adj
one value specifying the horizontal adjustment
justify
(deprecated, please use adj instead) character string specifying the horizontal adjustment; options are "left", "right", "center".
...
Material properties. See rgl.material for details.

Details

The adj parameter determines the position of the text relative to the specified coordinate. Use adj = 0 to place the left bottom corner at (x,y,z), adj = 0.5 to center the text there, and adj = 1 to put the right bottom corner there.

text3d and texts3d draw text using the r3d conventions. These are synonyms; the former is singular to be consistent with the classic 2-D graphics functions, and the latter is plural to be consistent with all the other graphics primitives. Take your choice!

See Also

r3d

Examples

Run this code
text3d(rnorm(10)*100,rnorm(10)*100,rnorm(10)*100,text=1:10,adj = 0.5, color=heat.colors(10))

Run the code above in your browser using DataLab