plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
16.01k stars 2.53k forks source link

Allow setting the camera "field of view" #4005

Open hhoppe opened 1 year ago

hhoppe commented 1 year ago

It doesn't seem possible to set the 3D camera field of view (fov).

(Re: my post to Stackoverflow.)

Looking at the source code, I see that:

In https://github.com/plotly/plotly.js/blob/master/src/plots/gl3d/scene.js, it uses glPlot3d.createScene and sets the options in proto.prepareOptions.

In https://github.com/gl-vis/gl-plot3d/blob/master/scene.js#L179, the allowed options include the field-of-view parameter fovy (field-of-view in the vertical direction), which defaults to Math.PI/4 (45 degrees).

For 3D graphics, a 45-degree vertical field-of-view typically gives an exaggerated perspective. It corresponds to about a 28mm camera lens.

It would be nice for plotly.graph_objects.layout.scene.Camera to include a fovy parameter (in radians).

hidara2000 commented 1 year ago

Is there any way to hack this for the moment? Cheers