How can I modify the aspect ratio of a Plotly 3D graph so that the data does not look deformed?

Viewed 19

I need to get the projections of an object from different locations. I have the code below but the scaling is not right (aspect ratio). Is there any way to fix this? (A picture of outputs can be found below)

from plyfile import PlyData, PlyElement
import plotly.graph_objects as go
import pandas as pd

plydata = PlyData.read('test.ply')
d_x=plydata['vertex']['x']
d_y=plydata['vertex']['y']
d_z=plydata['vertex']['z']

fig = go.Figure(data=[go.Scatter3d(x=d_x, y=d_y, z=d_z, mode='markers')])

name = 'default'
# Default parameters which are used when `layout.scene.camera` is not provided
camera = dict(
    up=dict(x=0, y=0, z=1),
    center=dict(x=0, y=0, z=0),
    eye=dict(x=0, y=-1, z=1)  
)
fig.update_layout(scene_camera=camera, title=name)
fig.show()
fig.write_image("fig1.png")

picture

0 Answers
Related