Plotly scatter3d aspectmode not consistent across axes

Viewed 159

Below is my plotly figure which can be seen here. I'm trying to get my image to show up as the 16x9 aspect ratio as stated within the axes ranges. However, when I set the aspectmode to data I get an extremely elongated plot that doesn't appear to match the correct aspect ratio.

Plot showing elogated graph where y axis is 2-4x larger than the z axis.

fig = go.Figure(
    data = go.Scatter3d(
        x=df['frame'], 
        y=df['x'], 
        z=df['y'],
        mode='markers',
        marker=dict(
            color=clusters.labels_,
            colorscale="Cividis",
            opacity=0.8
        )
    )
)
fig['layout']['scene']['aspectmode'] = "data"
fig['layout']['scene']['zaxis']['range'] = [1080, 0]
fig['layout']['scene']['yaxis']['range'] = [0, 1920]
fig.show()
0 Answers
Related