Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bbox

Set up bounding box decoration


Description

Set up the bounding box decoration.

Usage

rgl.bbox( 
	xat = NULL, xlab = NULL, xunit = 0, xlen = 5, 
	yat = NULL, ylab = NULL, yunit = 0, ylen = 5,
	zat = NULL, zlab = NULL, zunit = 0, zlen = 5,
	marklen = 15.0, marklen.rel = TRUE, expand = 1, 
	draw_front = FALSE, ...)
bbox3d(xat = NULL, yat = NULL, zat = NULL, 
	xunit = "pretty", yunit = "pretty", zunit = "pretty", 
	expand = 1.03,
	draw_front = FALSE, ...)

Arguments

xat, yat, zat

vector specifying the tickmark positions

xlab, ylab, zlab

character vector specifying the tickmark labeling

xunit, yunit, zunit

value specifying the tick mark base for uniform tick mark layout

xlen, ylen, zlen

value specifying the number of tickmarks

marklen

value specifying the length of the tickmarks

marklen.rel

logical, if TRUE tick mark length is calculated using 1/marklen * axis length, otherwise tick mark length is marklen in coordinate space

expand

value specifying how much to expand the bounding box around the data

draw_front

draw the front faces of the bounding box

...

Material properties (or other rgl.bbox parameters in the case of bbox3d). See rgl.material for details.

Details

Four different types of tick mark layouts are possible. This description applies to the X axis; other axes are similar: If xat is not NULL, the ticks are set up at custom positions. If xunit is numeric but not zero, it defines the tick mark base. If it is "pretty" (the default in bbox3d), ticks are set at pretty locations. If xlen is not zero, it specifies the number of ticks (a suggestion if xunit is "pretty").

The first color specifies the bounding box, while the second one specifies the tick mark and font color.

bbox3d defaults to pretty locations for the axis labels and a slightly larger box, whereas rgl.bbox covers the exact range.

axes3d offers more flexibility in the specification of the axes, but they are static, unlike those drawn by rgl.bbox and bbox3d.

Value

This function is called for the side effect of setting the bounding box decoration. A shape ID is returned to allow pop3d to delete it.

See Also

Examples

rgl.open()
  rgl.points(rnorm(100), rnorm(100), rnorm(100))
  rgl.bbox(color = c("#333377", "white"), emission = "#333377", 
           specular = "#3333FF", shininess = 5, alpha = 0.8 )
  
  open3d()
  points3d(rnorm(100), rnorm(100), rnorm(100))
  bbox3d(color = c("#333377", "black"), emission = "#333377", 
         specular = "#3333FF", shininess = 5, alpha = 0.8)

rgl

3D Visualization Using OpenGL

v0.106.8
GPL
Authors
Duncan Murdoch [aut, cre], Daniel Adler [aut], Oleg Nenadic [ctb], Simon Urbanek [ctb], Ming Chen [ctb], Albrecht Gebhardt [ctb], Ben Bolker [ctb], Gabor Csardi [ctb], Adam Strzelecki [ctb], Alexander Senger [ctb], The R Core Team [ctb, cph], Dirk Eddelbuettel [ctb], The authors of Shiny [cph], The authors of knitr [cph], Jeroen Ooms [ctb], Yohann Demont [ctb], Joshua Ulrich [ctb], Xavier Fernandez i Marin [ctb], George Helffrich [ctb], Ivan Krylov [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.