Black Lives Matter. Please consider donating to Black Girls Code today.

Prevent Autoscaling

Does anyone know how to stop the graph (specifically the 3d scatter plot) from autoscaling? Would love a constant an absolute 0-100 axes regardless of the data.

Thank you in advance!

You can specify axis limits in the layout (https://plot.ly/python/3d-axes/). Remember to use the plotly documents for styling graphs.

layout = go.Layout(
scene = dict(
xaxis = dict(
nticks=4, range = [-100,100],),
yaxis = dict(
nticks=4, range = [-50,100],),
zaxis = dict(
nticks=4, range = [-100,100],),),
width=700,
margin=dict(
r=20, l=10,
b=10, t=10)
)

1 Like