Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Setting x, y, z axes width for a 3d scatter plot in python

Hello !
I’m making some 3d scatter plots in python using plotly. Now My data points should give me a cuboid, as in x dimension is up to 100 and y is till 50, z is till 30. so I want to fix the same width for each unit in all 3 dimensions to observe a cuboid.

Right now, it outputs a cube with one unit on z,y equal to 2 on x.
Thanks !

You should try using the aspectratio scene attribute.

Sorry to reply so late, I was off work but Thanks !!! It worked for me now


How do use (syntactically) the aspect ratio attribute to set the axes length manually? I am a beginner in python. So, please help.

This is the syntax tried, but it doesn’t work:

layout = go.Layout(
scene = dict(
aspectmode = "manual"
aspectratio = dict( x = 10, y = 4, z = 5)