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"

y

The ratio for the y axis

z

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,"tag":""},"rootSubscene":164,"objects":{"170":{"id":170,"type":"points","material":{"lit":false},"vertices":"0","colors":"1","centers":"2","ignoreExtent":false,"flags":34816},"172":{"id":172,"type":"text","material":{"lit":false,"margin":0,"floating":true,"edge":[0,1,1]},"vertices":"3","colors":"4","texts":[["x"]],"cex":[[1]],"adj":[[0.5,0.5,0.5]],"centers":"5","family":[["sans"]],"font":[[1]],"ignoreExtent":true,"flags":33808},"173":{"id":173,"type":"text","material":{"lit":false,"margin":1,"floating":true,"edge":[1,1,1]},"vertices":"6","colors":"7","texts":[["y"]],"cex":[[1]],"adj":[[0.5,0.5,0.5]],"centers":"8","family":[["sans"]],"font":[[1]],"ignoreExtent":true,"flags":33808},"174":{"id":174,"type":"text","material":{"lit":false,"margin":2,"floating":true,"edge":[1,1,1]},"vertices":"9","colors":"10","texts":[["z"]],"cex":[[1]],"adj":[[0.5,0.5,0.5]],"centers":"11","family":[["sans"]],"font":[[1]],"ignoreExtent":true,"flags":33808},"168":{"id":168,"type":"light","vertices":[[0,0,1]],"colors":[[1,1,1,1],[1,1,1,1],[1,1,1,1]],"viewpoint":true,"finite":false},"167":{"id":167,"type":"background","material":{},"colors":"12","centers":"13","sphere":false,"fogtype":"none","fogscale":1,"flags":32768},"169":{"id":169,"type":"background","material":{"lit":false,"back":"lines"},"colors":"14","centers":"15","sphere":false,"fogtype":"none","fogscale":1,"flags":32768},"171":{"id":171,"type":"bboxdeco","material":{"front":"lines","back":"lines"},"vertices":"16","colors":"17","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,"flags":32769},"164":{"id":164,"type":"subscene","par3d":{"antialias":8,"FOV":30,"ignoreExtent":false,"listeners":164,"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":[0,0,256,256],"family":"sans","font":1,"cex":1,"useFreeType":true,"fontname":"NULL","maxClipPlanes":2147483647,"glVersion":"NA","activeSubscene":0},"embeddings":{"viewport":"replace","projection":"replace","model":"replace","mouse":"replace"},"objects":[169,171,170,172,173,174,168],"subscenes":[],"flags":36113}},"crosstalk":{"key":[],"group":[],"id":[],"options":[]},"width":480,"height":480,"context":{"shiny":false,"rmarkdown":null},"buffer":{"accessors":[{"bufferView":0,"componentType":5126,"count":100,"type":"VEC3"},{"bufferView":1,"componentType":5121,"count":1,"type":"VEC4"},{"bufferView":2,"componentType":5126,"count":100,"type":"VEC3"},{"bufferView":3,"componentType":5126,"count":1,"type":"VEC3"},{"bufferView":4,"componentType":5121,"count":1,"type":"VEC4"},{"bufferView":5,"componentType":5126,"count":1,"type":"VEC3"},{"bufferView":6,"componentType":5126,"count":1,"type":"VEC3"},{"bufferView":7,"componentType":5121,"count":1,"type":"VEC4"},{"bufferView":8,"componentType":5126,"count":1,"type":"VEC3"},{"bufferView":9,"componentType":5126,"count":1,"type":"VEC3"},{"bufferView":10,"componentType":5121,"count":1,"type":"VEC4"},{"bufferView":11,"componentType":5126,"count":1,"type":"VEC3"},{"bufferView":12,"componentType":5126,"count":1,"type":"VEC4"},{"bufferView":13,"componentType":5121,"count":1,"type":"VEC3"},{"bufferView":14,"componentType":5121,"count":1,"type":"VEC4"},{"bufferView":15,"componentType":5121,"count":1,"type":"VEC3"},{"bufferView":16,"componentType":5126,"count":13,"type":"VEC3"},{"bufferView":17,"componentType":5121,"count":1,"type":"VEC4"}],"bufferViews":[{"buffer":0,"byteLength":1200,"byteOffset":0},{"buffer":0,"byteLength":4,"byteOffset":1200},{"buffer":0,"byteLength":1200,"byteOffset":1204},{"buffer":0,"byteLength":12,"byteOffset":2404},{"buffer":0,"byteLength":4,"byteOffset":2416},{"buffer":0,"byteLength":12,"byteOffset":2420},{"buffer":0,"byteLength":12,"byteOffset":2432},{"buffer":0,"byteLength":4,"byteOffset":2444},{"buffer":0,"byteLength":12,"byteOffset":2448},{"buffer":0,"byteLength":12,"byteOffset":2460},{"buffer":0,"byteLength":4,"byteOffset":2472},{"buffer":0,"byteLength":12,"byteOffset":2476},{"buffer":0,"byteLength":16,"byteOffset":2488},{"buffer":0,"byteLength":3,"byteOffset":2504},{"buffer":0,"byteLength":4,"byteOffset":2507},{"buffer":0,"byteLength":3,"byteOffset":2511},{"buffer":0,"byteLength":156,"byteOffset":2516},{"buffer":0,"byteLength":4,"byteOffset":2672}],"buffers":[{"byteLength":2676,"bytes":"RksVQGGYQkBpu0LABWT6vur3hcCq4ATAVOVEvxUTq7yoDRnA0lh3v39TmkB+CYq/d0+iPx4q\nS7+UXqPA/jmNP92dKkCR8gQ/Fw72v9RMNj/1pl9AlF25vqg0Az+mXKM+CIkpP1XEWL7vwZE/\nP4oqvpu5qL8K17G/VQaju77kD76f1SnA5sCwv8RFm7/ghZ2+39Wgv/19Ez+hDh7Am4amPvPk\nPMDyIFHAA9ONvptBLL9rLby+cyzHvvB1AkAdywDAMO6aP8WsZ8DqojrA+o1wPrya+j8irUHA\ni6O3v0AlXr/eBW9A+/VrvyEPXkD/wwJAzcYKv8MdUz3anMa+71qTvwloAkBSkUvAC+VqP20O\nYT+5WN49Y+TXv6KKUsA/PmM/oGORv8Vt1T5q2JjA8WGcvX2svT0WExPAMi8dP5x7/D7saO6/\nHbwRQPnWfD8rt1M/H6KKvgEeL748tyfAsIrLvpGQgr69IwbAneA9v7GlpsCBSQHB/2H9v4pV\n8r7Mcu++75k4P0fmD0A/2iPA+h6FP+psF0CzDgHAI7Fjv9tRF0DWqRU/sUufPyL8vD+6Xuo/\n+xYoPIrRczslaRY/s1rLPqAo0L+SXhLAnWCeP3CAdb8o7PI/Kqwmv9MWd7+mC59AP95UP+nK\nxD8zzPw/LlRzP8+BvL3UmzPAHhPLP9qGwj/xIQlAJ9vGP3RiisCLkn1ATACTP6cYub/CwiHA\nHUKkv9l9ib/mLSK+i+YWP4KABkBVzXnAccOYvhegO8CEyDzAv0lcPRajzT5uTFrAeMSZP1zN\nWb9k5RZAe1tJP0x5RUAGqKs/smfkv1ougD/wEUhA1126PjUODkDsHzxAb6GBvsD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