I know there is a way to set the camera angle of a 3D scatter plot. I was just wondering if it possible to get the information of the camera angle (after plotting) when the graph has been rotated manually (eg. by the mouse)
?
Thanks
Edit: Sorry, I could have checked just a bit longer since I found kind of an answer:
Yeah, if you display the figure using a FigureWidget (https://plot.ly/python/figurewidget/) in the Jupyter Notebook then you can access properties to lookup the current values of properties that are chosen by ploty.js as defaults, and properties that are modified interactively.
Resurrecting an old threat. I have a similar question. Iโm setting up a 3d scatter plot using these initial camera properties:
fig.update_layout(scene_camera=dict(
eye=dict(x=1.2, y=1.2, z=0.6),
center=dict(x=0, y=0, z=0),
up=dict(x=0, y=0, z=1)
I then use the controls to adjust the figure and I expected these would adjust as I did that, but when I attempt to retrieve them I still get the original values. Iโd like to be able to adjust the figure, collect the resulting values, then use those as the initialization properties, but I canโt find the new properties. I could get there manually, but thatโs a lot of adjust, run, adjust and doesnโt take advantage of the ability to manipulate the image.
Is there a way to get the current updated properties?
I think that is due to how plotly works. Some things happen internally in the browser without being โreflectedโ in python.
If you are open to use dash, I think you could grab the new camera position via a clientside callback or even a regular callback via the restyleData or relayoutData, Iโm not sure right now, which of the two.
Thanks. Right now it is in a Jupyter notebook project Iโm doing for my AI and ML program. I was wanting to try plotly here and the ability to rotate the graph is nice, but I may have to fall back to matplotlib for this one due to ease of including it in my submission.