This function sets the apparent ratios of the x, y, and z axes of the current bounding box.

aspect3d(x, y = NULL, z = NULL)

## Arguments

x The ratio for the x axis, or all three ratios, or "iso" The ratio for the y axis The ratio for the z axis

## Details

If the ratios are all 1, the bounding box will be displayed as a cube approximately filling the display. Values may be set larger or smaller as desired. Aspect "iso" signifies that the coordinates should all be displayed at the same scale, i.e. the bounding box should not be rescaled. (This corresponds to the default display before aspect3d has been called.) Partial matches to "iso" are allowed.

aspect3d works by modifying par3d("scale").

## Value

The previous value of the scale is returned invisibly.

## Author

Duncan Murdoch

plot3d, par3d

## Examples

  x <- rnorm(100)
y <- rnorm(100)*2
z <- rnorm(100)*3

open3d()
plot3d(x, y, z)

{"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":170,"objects":{"176":{"id":176,"type":"points","material":{"lit":false},"vertices":[[2.33271932601929,3.04055047035217,-3.04268860816956],[-0.489044338464737,-4.18651294708252,-2.07621240615845],[-0.769124269485474,-0.020883122459054,-2.39145851135254],[-0.966199040412903,4.82269239425659,-1.07841467857361],[1.26805007457733,-0.793611407279968,-5.10529518127441],[1.10333228111267,2.66588521003723,0.519326269626617],[-1.92230498790741,0.712109804153442,3.49456524848938],[-0.36204206943512,0.512522220611572,0.319066226482391],[0.662247180938721,-0.211686447262764,1.13873088359833],[-0.166542991995811,-1.31816422939301,-1.38937497138977],[-0.00497512007132173,-0.140521019697189,-2.65366339683533],[-1.3808867931366,-1.21306657791138,-0.307662010192871],[-1.25652682781219,0.576141178607941,-2.46964287757874],[0.325245708227158,-2.95147395133972,-3.26763582229614],[-0.277000516653061,-0.672876060009003,-0.367534011602402],[-0.38901099562645,2.03844833374023,-2.01239705085754],[1.21039390563965,-3.61992001533508,-2.91619348526001],[0.234916597604752,1.95784711837769,-3.02619218826294],[-1.43467843532562,-0.867755889892578,3.73473310470581],[-0.921722114086151,3.46967339515686,2.04321265220642],[-0.542095959186554,0.051542054861784,-0.387915432453156],[-1.15121257305145,2.03759980201721,-3.18074464797974],[0.917557418346405,0.879126369953156,0.108567662537098],[-1.68665730953217,-3.28971147537231,0.887668550014496],[-1.1358528137207,0.416853100061417,-4.77641773223877],[-0.0763586834073067,0.0926141515374184,-2.29803991317749],[0.614001393318176,0.493130564689636,-1.86257696151733],[2.27710652351379,0.987655222415924,0.827013671398163],[-0.270768135786057,-0.17101289331913,-2.6205587387085],[-0.397542476654053,-0.255009204149246,-2.0959312915802],[-0.74170857667923,-5.2077260017395,-8.08044528961182],[-1.97955310344696,-0.473308861255646,-0.46767270565033],[0.721098840236664,2.24843001365662,-2.56019568443298],[1.04000782966614,2.36602258682251,-2.01652216911316],[-0.88942164182663,2.36437106132507,0.584622740745544],[1.24449741840363,1.47644448280334,1.83101582527161],[0.0102593852207065,0.00372037524357438,0.587541878223419],[0.39717635512352,-1.62623977661133,-2.28702211380005],[1.23732340335846,-0.958991050720215,1.89783191680908],[-0.651064515113831,-0.965192019939423,4.97017192840576],[0.831516206264496,1.53744232654572,1.97498166561127],[0.95050323009491,-0.0920444652438164,-2.80638599395752],[1.58652091026306,1.51974034309387,2.14269661903381],[1.55356299877167,-4.32451820373535,3.962069272995],[1.14844655990601,-1.44606482982635,-2.52751207351685],[-1.28326761722565,-1.07415306568146,-0.158378213644028],[0.589455306529999,2.10159349441528,-3.90315747261047],[-0.298366099596024,-2.93164610862732,-2.94973850250244],[0.0537812672555447,0.401634871959686,-3.4109148979187],[1.20130825042725,-0.850789785385132,2.35775089263916],[0.786552131175995,3.08552837371826,1.34106516838074],[-1.78441452980042,1.00141453742981,3.12609481811523],[0.36399719119072,2.21961712837219,2.93944835662842],[-0.253184765577316,-1.52248382568359,-6.94777059555054],[-0.277971893548965,2.41423225402832,-1.84131848812103],[-0.563868820667267,0.895059645175934,4.51089143753052],[0.147959753870964,1.80842256546021,4.08479404449463],[0.659715950489044,-0.665581107139587,-0.757827162742615],[0.402918636798859,3.0401976108551,2.19289064407349],[0.340969115495682,-2.1837010383606,-0.802769541740417],[-0.568359196186066,-0.783392250537872,-4.96431159973145],[0.0979634970426559,-2.13710951805115,1.54599249362946],[-0.44290691614151,-1.37740623950958,-3.7055778503418],[-1.80773961544037,1.57529056072235,1.09243822097778],[0.245090752840042,-0.548999786376953,7.02840900421143],[1.6730078458786,0.517603516578674,-1.44249176979065],[-1.38329410552979,4.71685552597046,-1.56241130828857],[1.14960467815399,1.25766050815582,-5.78651332855225],[1.00646770000458,0.292035132646561,1.95264792442322],[0.392570495605469,1.86676895618439,-0.637929379940033],[-0.88619327545166,0.179604947566986,-4.48356342315674],[-1.3717542886734,-1.2017765045166,-1.12836050987244],[1.52129673957825,2.27024579048157,5.38860559463501],[0.57155042886734,0.25480842590332,1.73485267162323],[0.239980891346931,1.21242308616638,-2.48639678955078],[0.293443709611893,0.581873536109924,2.95297980308533],[-1.52438056468964,0.328118532896042,-1.73905634880066],[1.14314699172974,0.65612119436264,-0.0439904816448689],[1.6038111448288,-2.77992630004883,-2.318284034729],[0.0317421294748783,0.975263774394989,-5.90474891662598],[-1.22758388519287,-2.10827589035034,2.99433755874634],[-0.312468856573105,-0.067942276597023,1.25453507900238],[-0.484906941652298,-0.00448707630857825,-2.33451962471008],[0.771982252597809,-0.620123386383057,-5.90204381942749],[0.400444597005844,-2.88921904563904,0.180082082748413],[-0.851851224899292,3.5262668132782,4.45651006698608],[-0.133894845843315,-0.316350013017654,-0.925993382930756],[1.53020143508911,-3.55521464347839,-3.11289119720459],[0.256574273109436,-1.98104798793793,0.469009876251221],[0.875489830970764,1.72594690322876,2.64587330818176],[1.04528331756592,1.37924373149872,0.115909390151501],[1.86461555957794,-1.11292600631714,-2.73605537414551],[-2.55140733718872,0.870720565319061,-4.93739080429077],[-2.52123999595642,1.95942866802216,-3.85713744163513],[0.779521107673645,0.802479088306427,-0.857912719249725],[-0.335325211286545,-1.30122709274292,1.63447976112366],[0.929726660251617,1.43513774871826,5.44286441802979],[0.312910944223404,-1.23793065547943,-2.9701087474823],[-0.000204296957235783,-0.129849970340729,-1.55409777164459],[-0.250647693872452,1.51316463947296,2.7838442325592]],"colors":[[0,0,0,1]],"centers":[[2.33271932601929,3.04055047035217,-3.04268860816956],[-0.489044338464737,-4.18651294708252,-2.07621240615845],[-0.769124269485474,-0.020883122459054,-2.39145851135254],[-0.966199040412903,4.82269239425659,-1.07841467857361],[1.26805007457733,-0.793611407279968,-5.10529518127441],[1.10333228111267,2.66588521003723,0.519326269626617],[-1.92230498790741,0.712109804153442,3.49456524848938],[-0.36204206943512,0.512522220611572,0.319066226482391],[0.662247180938721,-0.211686447262764,1.13873088359833],[-0.166542991995811,-1.31816422939301,-1.38937497138977],[-0.00497512007132173,-0.140521019697189,-2.65366339683533],[-1.3808867931366,-1.21306657791138,-0.307662010192871],[-1.25652682781219,0.576141178607941,-2.46964287757874],[0.325245708227158,-2.95147395133972,-3.26763582229614],[-0.277000516653061,-0.672876060009003,-0.367534011602402],[-0.38901099562645,2.03844833374023,-2.01239705085754],[1.21039390563965,-3.61992001533508,-2.91619348526001],[0.234916597604752,1.95784711837769,-3.02619218826294],[-1.43467843532562,-0.867755889892578,3.73473310470581],[-0.921722114086151,3.46967339515686,2.04321265220642],[-0.542095959186554,0.051542054861784,-0.387915432453156],[-1.15121257305145,2.03759980201721,-3.18074464797974],[0.917557418346405,0.879126369953156,0.108567662537098],[-1.68665730953217,-3.28971147537231,0.887668550014496],[-1.1358528137207,0.416853100061417,-4.77641773223877],[-0.0763586834073067,0.0926141515374184,-2.29803991317749],[0.614001393318176,0.493130564689636,-1.86257696151733],[2.27710652351379,0.987655222415924,0.827013671398163],[-0.270768135786057,-0.17101289331913,-2.6205587387085],[-0.397542476654053,-0.255009204149246,-2.0959312915802],[-0.74170857667923,-5.2077260017395,-8.08044528961182],[-1.97955310344696,-0.473308861255646,-0.46767270565033],[0.721098840236664,2.24843001365662,-2.56019568443298],[1.04000782966614,2.36602258682251,-2.01652216911316],[-0.88942164182663,2.36437106132507,0.584622740745544],[1.24449741840363,1.47644448280334,1.83101582527161],[0.0102593852207065,0.00372037524357438,0.587541878223419],[0.39717635512352,-1.62623977661133,-2.28702211380005],[1.23732340335846,-0.958991050720215,1.89783191680908],[-0.651064515113831,-0.965192019939423,4.97017192840576],[0.831516206264496,1.53744232654572,1.97498166561127],[0.95050323009491,-0.0920444652438164,-2.80638599395752],[1.58652091026306,1.51974034309387,2.14269661903381],[1.55356299877167,-4.32451820373535,3.962069272995],[1.14844655990601,-1.44606482982635,-2.52751207351685],[-1.28326761722565,-1.07415306568146,-0.158378213644028],[0.589455306529999,2.10159349441528,-3.90315747261047],[-0.298366099596024,-2.93164610862732,-2.94973850250244],[0.0537812672555447,0.401634871959686,-3.4109148979187],[1.20130825042725,-0.850789785385132,2.35775089263916],[0.786552131175995,3.08552837371826,1.34106516838074],[-1.78441452980042,1.00141453742981,3.12609481811523],[0.36399719119072,2.21961712837219,2.93944835662842],[-0.253184765577316,-1.52248382568359,-6.94777059555054],[-0.277971893548965,2.41423225402832,-1.84131848812103],[-0.563868820667267,0.895059645175934,4.51089143753052],[0.147959753870964,1.80842256546021,4.08479404449463],[0.659715950489044,-0.665581107139587,-0.757827162742615],[0.402918636798859,3.0401976108551,2.19289064407349],[0.340969115495682,-2.1837010383606,-0.802769541740417],[-0.568359196186066,-0.783392250537872,-4.96431159973145],[0.0979634970426559,-2.13710951805115,1.54599249362946],[-0.44290691614151,-1.37740623950958,-3.7055778503418],[-1.80773961544037,1.57529056072235,1.09243822097778],[0.245090752840042,-0.548999786376953,7.02840900421143],[1.6730078458786,0.517603516578674,-1.44249176979065],[-1.38329410552979,4.71685552597046,-1.56241130828857],[1.14960467815399,1.25766050815582,-5.78651332855225],[1.00646770000458,0.292035132646561,1.95264792442322],[0.392570495605469,1.86676895618439,-0.637929379940033],[-0.88619327545166,0.179604947566986,-4.48356342315674],[-1.3717542886734,-1.2017765045166,-1.12836050987244],[1.52129673957825,2.27024579048157,5.38860559463501],[0.57155042886734,0.25480842590332,1.73485267162323],[0.239980891346931,1.21242308616638,-2.48639678955078],[0.293443709611893,0.581873536109924,2.95297980308533],[-1.52438056468964,0.328118532896042,-1.73905634880066],[1.14314699172974,0.65612119436264,-0.0439904816448689],[1.6038111448288,-2.77992630004883,-2.318284034729],[0.0317421294748783,0.975263774394989,-5.90474891662598],[-1.22758388519287,-2.10827589035034,2.99433755874634],[-0.312468856573105,-0.067942276597023,1.25453507900238],[-0.484906941652298,-0.00448707630857825,-2.33451962471008],[0.771982252597809,-0.620123386383057,-5.90204381942749],[0.400444597005844,-2.88921904563904,0.180082082748413],[-0.851851224899292,3.5262668132782,4.45651006698608],[-0.133894845843315,-0.316350013017654,-0.925993382930756],[1.53020143508911,-3.55521464347839,-3.11289119720459],[0.256574273109436,-1.98104798793793,0.469009876251221],[0.875489830970764,1.72594690322876,2.64587330818176],[1.04528331756592,1.37924373149872,0.115909390151501],[1.86461555957794,-1.11292600631714,-2.73605537414551],[-2.55140733718872,0.870720565319061,-4.93739080429077],[-2.52123999595642,1.95942866802216,-3.85713744163513],[0.779521107673645,0.802479088306427,-0.857912719249725],[-0.335325211286545,-1.30122709274292,1.63447976112366],[0.929726660251617,1.43513774871826,5.44286441802979],[0.312910944223404,-1.23793065547943,-2.9701087474823],[-0.000204296957235783,-0.129849970340729,-1.55409777164459],[-0.250647693872452,1.51316463947296,2.7838442325592]],"ignoreExtent":false,"flags":34816},"178":{"id":178,"type":"text","material":{"lit":false,"margin":0,"floating":true,"edge":[0,1,1]},"vertices":[["NaN",4,1]],"colors":[[0,0,0,1]],"texts":[["x"]],"cex":[[1]],"adj":[[0.5,0.5,0.5]],"centers":[["NaN",4,1]],"family":[["sans"]],"font":[[1]],"ignoreExtent":true,"flags":33808},"179":{"id":179,"type":"text","material":{"lit":false,"margin":1,"floating":true,"edge":[1,1,1]},"vertices":[["NaN",4,1]],"colors":[[0,0,0,1]],"texts":[["y"]],"cex":[[1]],"adj":[[0.5,0.5,0.5]],"centers":[["NaN",4,1]],"family":[["sans"]],"font":[[1]],"ignoreExtent":true,"flags":33808},"180":{"id":180,"type":"text","material":{"lit":false,"margin":2,"floating":true,"edge":[1,1,1]},"vertices":[["NaN",4,1]],"colors":[[0,0,0,1]],"texts":[["z"]],"cex":[[1]],"adj":[[0.5,0.5,0.5]],"centers":[["NaN",4,1]],"family":[["sans"]],"font":[[1]],"ignoreExtent":true,"flags":33808},"174":{"id":174,"type":"light","vertices":[[0,0,1]],"colors":[[1,1,1,1],[1,1,1,1],[1,1,1,1]],"viewpoint":true,"finite":false},"173":{"id":173,"type":"background","material":{},"colors":[[0.298039227724075,0.298039227724075,0.298039227724075,1]],"centers":[[0,0,0]],"sphere":false,"fogtype":"none","fogscale":1,"flags":32768},"175":{"id":175,"type":"background","material":{"lit":false,"back":"lines"},"colors":[[1,1,1,1]],"centers":[[0,0,0]],"sphere":false,"fogtype":"none","fogscale":1,"flags":32768},"177":{"id":177,"type":"bboxdeco","material":{"front":"lines","back":"lines"},"vertices":[[-2,"NA","NA"],[-1,"NA","NA"],[0,"NA","NA"],[1,"NA","NA"],[2,"NA","NA"],["NA",-4,"NA"],["NA",-2,"NA"],["NA",0,"NA"],["NA",2,"NA"],["NA",4,"NA"],["NA","NA",-5],["NA","NA",0],["NA","NA",5]],"colors":[[0,0,0,1]],"axes":{"mode":["pretty","pretty","pretty"],"step":[1,2,5],"nticks":[5,5,5],"marklen":[15,15,15],"expand":[1.02999997138977,1.02999997138977,1.02999997138977]},"draw_front":true},"170":{"id":170,"type":"subscene","par3d":{"antialias":8,"FOV":30,"ignoreExtent":false,"listeners":170,"mouseMode":{"none":"none","left":"trackball","right":"zoom","middle":"fov","wheel":"pull"},"observer":[0,0,45.9583435058594],"modelMatrix":[[1,0,0,0.109344005584717],[0,0.342020153999329,0.939692616462708,0.560140013694763],[0,-0.939692616462708,0.342020153999329,-45.959342956543],[0,0,0,1]],"projMatrix":[[3.73205089569092,0,0,0],[0,3.73205089569092,0,0],[0,0,-3.86370301246643,-165.674514770508],[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.55140733718872,2.33271932601929,-5.2077260017395,4.82269239425659,-8.08044528961182,7.02840900421143],"windowRect":[180,225,436,481],"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":[175,177,176,178,179,180,174],"subscenes":[],"flags":36112}},"crosstalk":{"key":[],"group":[],"id":[],"options":[]},"width":480,"height":480,"context":{"shiny":false,"rmarkdown":null},"players":[],"webGLoptions":{"preserveDrawingBuffer":true}},"evals":[],"jsHooks":[]}