# Plot 3D in natural scale

**URL:** <https://community.plotly.com/t/plot-3d-in-natural-scale/2588>\
**Category:** plotly.js\
**Created:** [November 2, 2016, 2:40pm UTC](https://community.plotly.com/t/plot-3d-in-natural-scale/2588 "2016-11-02T14:40:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![balint](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@balint](https://community.plotly.com/u/balint)\
**Post date:** [November 2, 2016, 2:40pm UTC](https://community.plotly.com/t/plot-3d-in-natural-scale/2588/1 "2016-11-02T14:40:14Z")

</div>

I’d like to plot 3D objects in natural scale but even I define the size of the three axis equally, the view is deformed so the plot won’t be proportionally scaled.  
I use layout’s scene method without success.  
scene: {  
xaxis: {range: [-18, 0]},  
yaxis: {range: [-18, 0]},  
zaxis: {range: [0, 18]}  
},

In some cases of my data sequence, the three axis have the same size but in others I get distortion.  
Any idea about the reason?

Thanks in Advanced!

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [November 2, 2016, 3:33pm UTC](https://community.plotly.com/t/plot-3d-in-natural-scale/2588/2 "2016-11-02T15:33:50Z")

</div>

Here’s how: [http://codepen.io/etpinard/pen/GNKrvW](http://codepen.io/etpinard/pen/GNKrvW)

plotly.js tries to be _smart_ by scaling back the scene to a cude when x/y/z are too dissimilar.

By setting `scene.aspectratio: 'data'`, the x/y/z range are always honored.

---

<div class="post-metadata">

**Author:** ![balint](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@balint](https://community.plotly.com/u/balint)\
**Post date:** [November 2, 2016, 3:56pm UTC](https://community.plotly.com/t/plot-3d-in-natural-scale/2588/3 "2016-11-02T15:56:59Z")

</div>

> [@etienne](#):
>
> scene.aspectratio

Thanks etienne! Now it works as I wish.

---

<div class="post-metadata">

**Author:** ![vvv](https://avatars.discourse-cdn.com/v4/letter/v/41988e/32.png) [@vvv](https://community.plotly.com/u/vvv)\
**Post date:** [August 30, 2018, 9:23pm UTC](https://community.plotly.com/t/plot-3d-in-natural-scale/2588/4 "2018-08-30T21:23:54Z")

</div>

`aspectmode: 'data'` works for me, `scene.aspectratio: 'data'` is giving me an error.

---

<div class="post-metadata">

**Author:** ![jucat](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jucat](https://community.plotly.com/u/jucat)\
**Post date:** [May 11, 2024, 8:09am UTC](https://community.plotly.com/t/plot-3d-in-natural-scale/2588/5 "2024-05-11T08:09:40Z")

</div>

It works well, thanks
