Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rotate the 3D scatter plots in google colaboratory?

I am generating a 3d scatter plot in google colab, but the problem is that the generated fig is static and is not rotatable. I also tried the command

%matplotlib notebook

to enable the 3D scatter rotation as it apparently work in jupyter notebook environment,but it seems this doesn't work in google colab environment.

you can find my code here

like image 317
Peyman Tehrani Avatar asked Aug 21 '18 01:08

Peyman Tehrani


People also ask

How do you rotate a 3D scatter plot?

Click on the 3D plot window and drag the mouse on the plot. This should rotate the surface in the direction you move the mouse about the focus point (the origin, by default).

How do you rotate a 3D graph?

Rotating 3D Graphs When the mouse is moved onto the graph, it will become a circle curve with a clockwise arrow. Drag the mouse to rotate the 3D graph around any axis. To rotate the 3D graph around the X axis press CTRL and drag. To rotate around the Y axis, press SHIFT and drag.

How do you rotate a 3D figure in Python?

Plot a 3D wireframe with data test data x, y, and z. To make it rotatable, we can set the elevation and azimuth of the axes in degrees (not radians), using view_init() method. To show the figure, use plt. show() method.

How do you make a 3D plot interactive?

To generate an interactive 3D plot first import the necessary packages and create a random dataset. Now using Axes3D(figure) function from the mplot3d library we can generate a required plot directly. Pass the data to the 3D plot and configure the title and labels.


1 Answers

Try plotly (python graphic libraries) 3D scatter plot.

like image 183
vesszabo Avatar answered Sep 22 '22 18:09

vesszabo