Set up the bounding box decoration.

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 character vector specifying the tickmark labeling value specifying the tick mark base for uniform tick mark layout value specifying the number of tickmarks value specifying the length of the tickmarks logical, if TRUE tick mark length is calculated using 1/marklen * axis length, otherwise tick mark length is marklen in coordinate space value specifying how much to expand the bounding box around the data 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.

rgl.material, axes3d

## 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 )

{"x":{"material":{"color":"#000000","alpha":1,"lit":true,"ambient":"#000000","specular":"#FFFFFF","emission":"#000000","shininess":50,"smooth":true,"front":"filled","back":"filled","size":3,"lwd":1,"fog":true,"point_antialias":false,"line_antialias":false,"texture":null,"textype":"rgb","texmipmap":false,"texminfilter":"linear","texmagfilter":"linear","texenvmap":false,"depth_mask":true,"depth_test":"less","isTransparent":false,"polygon_offset":[0,0],"margin":"","floating":false},"rootSubscene":273,"objects":{"279":{"id":279,"type":"points","material":{"lit":false},"vertices":[[1.70559275150299,-1.06852602958679,0.925032615661621],[0.30669903755188,1.42571580410004,-0.968258619308472],[-0.233806192874908,1.1995701789856,0.826995432376862],[-0.57237583398819,-1.67803645133972,-0.69450443983078],[1.18807888031006,1.82880616188049,-0.258129954338074],[0.548210918903351,-0.535208880901337,-0.509511411190033],[-1.52223014831543,-0.835660636425018,-0.409117311239243],[1.02867722511292,-0.758469879627228,-2.65533185005188],[0.789193689823151,-1.32412993907928,0.251863121986389],[0.340937584638596,0.788467466831207,-0.931551218032837],[-1.49436664581299,-1.37671852111816,-0.626786470413208],[-0.225543588399887,-1.07039523124695,-1.10193634033203],[-0.307737022638321,-0.986740946769714,-0.124774441123009],[0.177667081356049,0.536586165428162,-0.289416491985321],[-2.22566342353821,-0.445206582546234,0.94458544254303],[0.974740982055664,-0.00350143690593541,0.710177361965179],[-1.56791388988495,-0.623814105987549,0.499788790941238],[-0.290134847164154,0.460846930742264,-2.06575226783752],[-1.08566248416901,-0.577520132064819,0.313389629125595],[-0.487192720174789,1.68760859966278,-1.93840622901917],[-0.88277280330658,0.0256605166941881,2.37708044052124],[0.186851873993874,-0.590307176113129,0.0952575653791428],[-0.163639053702354,1.38202178478241,-1.22825980186462],[-0.0883055776357651,0.0319013372063637,-0.000452797277830541],[0.635917484760284,-1.00250673294067,0.181623324751854],[0.996137619018555,-0.955665051937103,1.05912959575653],[1.08672976493835,0.490565687417984,1.16579365730286],[0.476887613534927,-1.17941737174988,-3.82519268989563],[-0.246815428137779,1.55675446987152,0.9734126329422],[-0.879350900650024,-0.904260993003845,-1.8747091293335],[-1.17476511001587,-1.50270295143127,0.696300804615021],[1.31353068351746,-1.56483733654022,-1.55170917510986],[0.101634956896305,-0.994172632694244,-0.217202752828598],[1.91775596141815,0.557528138160706,0.200334042310715],[0.772055268287659,-1.93277955055237,2.244460105896],[0.60817939043045,-0.488079339265823,-0.598134815692902],[-0.149808645248413,-0.0706973597407341,2.37639880180359],[0.902953803539276,-1.41958725452423,-1.42285525798798],[1.00686180591583,0.189548462629318,-0.417662978172302],[-2.10445880889893,-2.62243390083313,-0.671900153160095],[-0.0553629286587238,-1.67694389820099,-0.939307928085327],[-0.14274263381958,1.54275631904602,0.500342547893524],[0.44818240404129,1.68123030662537,0.495779424905777],[1.93783855438232,1.04310166835785,-2.29226565361023],[1.93048274517059,2.54097104072571,-0.962505757808685],[0.637576401233673,-0.561779499053955,-1.68583965301514],[0.378542274236679,1.7440459728241,1.22092580795288],[2.64417147636414,-1.14145958423615,0.858955979347229],[0.72515732049942,0.909333467483521,0.49512505531311],[-1.30946207046509,-1.69329535961151,1.89631569385529],[-0.868863224983215,0.538308441638947,0.0458428412675858],[-0.0135688567534089,-2.14713978767395,0.32322084903717],[0.999472081661224,-1.65429818630219,-1.09725320339203],[-0.588890194892883,-1.17214071750641,2.11922001838684],[0.543692469596863,-0.739100515842438,-0.208625286817551],[-1.33766734600067,0.19250114262104,-0.587269365787506],[0.293055295944214,-0.189737647771835,-0.484207063913345],[-0.27023184299469,1.33368504047394,2.22914958000183],[1.31005227565765,1.487797498703,-1.05489218235016],[1.69318878650665,0.860573291778564,0.465407878160477],[0.150314196944237,-0.409988224506378,-0.193418443202972],[0.314554333686829,0.00960373505949974,0.965364158153534],[-0.0519944317638874,-0.144265413284302,0.86761212348938],[0.956109046936035,1.00106644630432,-1.07545638084412],[0.193907186388969,-0.074340283870697,-2.3961124420166],[-0.548031032085419,-0.752389252185822,1.84594893455505],[0.305963724851608,0.551741778850555,2.14341402053833],[-0.722769975662231,-2.17821669578552,-0.649596571922302],[-0.950418531894684,0.0925111398100853,1.62753736972809],[0.213063731789589,-0.687099575996399,0.62612909078598],[0.60949718952179,-0.350172519683838,-0.230223342776299],[0.442387968301773,0.599933266639709,0.727650940418243],[-0.356939613819122,0.232440426945686,-0.00385674391873181],[1.75191676616669,0.624939024448395,0.68226021528244],[-0.848822891712189,0.0277942791581154,0.266750335693359],[-0.0368490479886532,-0.838782608509064,0.442835330963135],[-0.444763511419296,-1.01781058311462,-0.160095632076263],[0.478518128395081,-0.0478021129965782,0.302733093500137],[-0.0778624415397644,2.02224493026733,1.43175542354584],[-0.00360962352715433,-1.69763112068176,0.760364294052124],[0.489831030368805,0.168382838368416,0.457884877920151],[-1.21486246585846,-0.522232949733734,0.24781322479248],[-0.197096839547157,-0.731790065765381,-0.0116793494671583],[1.70865094661713,0.556454539299011,-1.48046433925629],[-0.759601354598999,-0.240562677383423,-0.880207240581512],[0.97236955165863,1.36558771133423,0.998593270778656],[-1.03184032440186,-0.778743922710419,0.208854511380196],[0.7685866355896,-1.74315655231476,-0.508443236351013],[0.301285058259964,-1.21162247657776,0.653394818305969],[0.424560576677322,-1.2204657793045,-1.00993239879608],[0.0065710567869246,0.731305837631226,0.203324511647224],[0.741297721862793,0.117969237267971,-0.834511399269104],[1.55900752544403,0.605659186840057,-0.625257790088654],[-0.417168766260147,0.25526025891304,0.511477053165436],[-0.420322954654694,0.939343154430389,-0.5993492603302],[0.697185873985291,1.18999409675598,-0.0938763990998268],[-0.210961610078812,0.952082753181458,0.312626332044601],[1.54108548164368,-0.428301364183426,-1.1271904706955],[0.284831970930099,-0.873020052909851,2.37890529632568],[0.321961373090744,0.539833903312683,1.04613530635834]],"colors":[[0,0,0,1]],"centers":[[1.70559275150299,-1.06852602958679,0.925032615661621],[0.30669903755188,1.42571580410004,-0.968258619308472],[-0.233806192874908,1.1995701789856,0.826995432376862],[-0.57237583398819,-1.67803645133972,-0.69450443983078],[1.18807888031006,1.82880616188049,-0.258129954338074],[0.548210918903351,-0.535208880901337,-0.509511411190033],[-1.52223014831543,-0.835660636425018,-0.409117311239243],[1.02867722511292,-0.758469879627228,-2.65533185005188],[0.789193689823151,-1.32412993907928,0.251863121986389],[0.340937584638596,0.788467466831207,-0.931551218032837],[-1.49436664581299,-1.37671852111816,-0.626786470413208],[-0.225543588399887,-1.07039523124695,-1.10193634033203],[-0.307737022638321,-0.986740946769714,-0.124774441123009],[0.177667081356049,0.536586165428162,-0.289416491985321],[-2.22566342353821,-0.445206582546234,0.94458544254303],[0.974740982055664,-0.00350143690593541,0.710177361965179],[-1.56791388988495,-0.623814105987549,0.499788790941238],[-0.290134847164154,0.460846930742264,-2.06575226783752],[-1.08566248416901,-0.577520132064819,0.313389629125595],[-0.487192720174789,1.68760859966278,-1.93840622901917],[-0.88277280330658,0.0256605166941881,2.37708044052124],[0.186851873993874,-0.590307176113129,0.0952575653791428],[-0.163639053702354,1.38202178478241,-1.22825980186462],[-0.0883055776357651,0.0319013372063637,-0.000452797277830541],[0.635917484760284,-1.00250673294067,0.181623324751854],[0.996137619018555,-0.955665051937103,1.05912959575653],[1.08672976493835,0.490565687417984,1.16579365730286],[0.476887613534927,-1.17941737174988,-3.82519268989563],[-0.246815428137779,1.55675446987152,0.9734126329422],[-0.879350900650024,-0.904260993003845,-1.8747091293335],[-1.17476511001587,-1.50270295143127,0.696300804615021],[1.31353068351746,-1.56483733654022,-1.55170917510986],[0.101634956896305,-0.994172632694244,-0.217202752828598],[1.91775596141815,0.557528138160706,0.200334042310715],[0.772055268287659,-1.93277955055237,2.244460105896],[0.60817939043045,-0.488079339265823,-0.598134815692902],[-0.149808645248413,-0.0706973597407341,2.37639880180359],[0.902953803539276,-1.41958725452423,-1.42285525798798],[1.00686180591583,0.189548462629318,-0.417662978172302],[-2.10445880889893,-2.62243390083313,-0.671900153160095],[-0.0553629286587238,-1.67694389820099,-0.939307928085327],[-0.14274263381958,1.54275631904602,0.500342547893524],[0.44818240404129,1.68123030662537,0.495779424905777],[1.93783855438232,1.04310166835785,-2.29226565361023],[1.93048274517059,2.54097104072571,-0.962505757808685],[0.637576401233673,-0.561779499053955,-1.68583965301514],[0.378542274236679,1.7440459728241,1.22092580795288],[2.64417147636414,-1.14145958423615,0.858955979347229],[0.72515732049942,0.909333467483521,0.49512505531311],[-1.30946207046509,-1.69329535961151,1.89631569385529],[-0.868863224983215,0.538308441638947,0.0458428412675858],[-0.0135688567534089,-2.14713978767395,0.32322084903717],[0.999472081661224,-1.65429818630219,-1.09725320339203],[-0.588890194892883,-1.17214071750641,2.11922001838684],[0.543692469596863,-0.739100515842438,-0.208625286817551],[-1.33766734600067,0.19250114262104,-0.587269365787506],[0.293055295944214,-0.189737647771835,-0.484207063913345],[-0.27023184299469,1.33368504047394,2.22914958000183],[1.31005227565765,1.487797498703,-1.05489218235016],[1.69318878650665,0.860573291778564,0.465407878160477],[0.150314196944237,-0.409988224506378,-0.193418443202972],[0.314554333686829,0.00960373505949974,0.965364158153534],[-0.0519944317638874,-0.144265413284302,0.86761212348938],[0.956109046936035,1.00106644630432,-1.07545638084412],[0.193907186388969,-0.074340283870697,-2.3961124420166],[-0.548031032085419,-0.752389252185822,1.84594893455505],[0.305963724851608,0.551741778850555,2.14341402053833],[-0.722769975662231,-2.17821669578552,-0.649596571922302],[-0.950418531894684,0.0925111398100853,1.62753736972809],[0.213063731789589,-0.687099575996399,0.62612909078598],[0.60949718952179,-0.350172519683838,-0.230223342776299],[0.442387968301773,0.599933266639709,0.727650940418243],[-0.356939613819122,0.232440426945686,-0.00385674391873181],[1.75191676616669,0.624939024448395,0.68226021528244],[-0.848822891712189,0.0277942791581154,0.266750335693359],[-0.0368490479886532,-0.838782608509064,0.442835330963135],[-0.444763511419296,-1.01781058311462,-0.160095632076263],[0.478518128395081,-0.0478021129965782,0.302733093500137],[-0.0778624415397644,2.02224493026733,1.43175542354584],[-0.00360962352715433,-1.69763112068176,0.760364294052124],[0.489831030368805,0.168382838368416,0.457884877920151],[-1.21486246585846,-0.522232949733734,0.24781322479248],[-0.197096839547157,-0.731790065765381,-0.0116793494671583],[1.70865094661713,0.556454539299011,-1.48046433925629],[-0.759601354598999,-0.240562677383423,-0.880207240581512],[0.97236955165863,1.36558771133423,0.998593270778656],[-1.03184032440186,-0.778743922710419,0.208854511380196],[0.7685866355896,-1.74315655231476,-0.508443236351013],[0.301285058259964,-1.21162247657776,0.653394818305969],[0.424560576677322,-1.2204657793045,-1.00993239879608],[0.0065710567869246,0.731305837631226,0.203324511647224],[0.741297721862793,0.117969237267971,-0.834511399269104],[1.55900752544403,0.605659186840057,-0.625257790088654],[-0.417168766260147,0.25526025891304,0.511477053165436],[-0.420322954654694,0.939343154430389,-0.5993492603302],[0.697185873985291,1.18999409675598,-0.0938763990998268],[-0.210961610078812,0.952082753181458,0.312626332044601],[1.54108548164368,-0.428301364183426,-1.1271904706955],[0.284831970930099,-0.873020052909851,2.37890529632568],[0.321961373090744,0.539833903312683,1.04613530635834]],"ignoreExtent":false,"flags":34816},"277":{"id":277,"type":"light","vertices":[[0,0,1]],"colors":[[1,1,1,1],[1,1,1,1],[1,1,1,1]],"viewpoint":true,"finite":false},"276":{"id":276,"type":"background","material":{},"colors":[[0.298039227724075,0.298039227724075,0.298039227724075,1]],"centers":[[0,0,0]],"sphere":false,"fogtype":"none","fogscale":1,"flags":32768},"278":{"id":278,"type":"background","material":{"lit":false,"back":"lines"},"colors":[[1,1,1,1]],"centers":[[0,0,0]],"sphere":false,"fogtype":"none","fogscale":1,"flags":32768},"280":{"id":280,"type":"bboxdeco","material":{"color":["#333377","#000000"],"alpha":[0.800000011920929,0.800000011920929],"specular":"#3333FF","emission":"#333377","shininess":5,"isTransparent":true},"vertices":[[-2,"NA","NA"],[-1,"NA","NA"],[0,"NA","NA"],[1,"NA","NA"],[2,"NA","NA"],["NA",-2,"NA"],["NA",-1,"NA"],["NA",0,"NA"],["NA",1,"NA"],["NA",2,"NA"],["NA","NA",-3],["NA","NA",-2],["NA","NA",-1],["NA","NA",0],["NA","NA",1],["NA","NA",2]],"colors":[[0.200000002980232,0.200000002980232,0.466666668653488,0.800000011920929],[0,0,0,0.800000011920929]],"axes":{"mode":["pretty","pretty","pretty"],"step":[1,1,1],"nticks":[5,5,5],"marklen":[15,15,15],"expand":[1.02999997138977,1.02999997138977,1.02999997138977]},"draw_front":false},"273":{"id":273,"type":"subscene","par3d":{"antialias":8,"FOV":30,"ignoreExtent":false,"listeners":273,"mouseMode":{"none":"none","left":"trackball","right":"zoom","middle":"fov","wheel":"pull"},"observer":[0,0,23.0677947998047],"modelMatrix":[[1,0,0,-0.209254026412964],[0,0.342020153999329,0.939692616462708,0.693463742733002],[0,-0.939692616462708,0.342020153999329,-22.8587398529053],[0,0,0,1]],"projMatrix":[[3.73205065727234,0,0,0],[0,3.73205065727234,0,0],[0,0,-3.86370325088501,-83.1567306518555],[0,0,-1,0]],"skipRedraw":false,"userMatrix":[[1,0,0,0],[0,0.342020143325668,0.939692620785909,0],[0,-0.939692620785909,0.342020143325668,0],[0,0,0,1]],"userProjection":[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],"scale":[1,1,1],"viewport":{"x":0,"y":0,"width":1,"height":1},"zoom":1,"bbox":[-2.22566342353821,2.64417147636414,-2.62243390083313,2.54097104072571,-3.82519268989563,2.37890529632568],"windowRect":[260,305,516,561],"family":"sans","font":1,"cex":1,"useFreeType":true,"fontname":"/Library/Frameworks/R.framework/Versions/4.1/Resources/library/rgl/fonts/FreeSans.ttf","maxClipPlanes":6,"glVersion":2.1,"activeSubscene":0},"embeddings":{"viewport":"replace","projection":"replace","model":"replace","mouse":"replace"},"objects":[278,280,279,277],"subscenes":[],"flags":35072}},"crosstalk":{"key":[],"group":[],"id":[],"options":[]},"width":480,"height":480,"context":{"shiny":false,"rmarkdown":null},"players":[],"webGLoptions":{"preserveDrawingBuffer":true}},"evals":[],"jsHooks":[]}