The interactive backends also provide the ability to rotate and zoom the 3D scene. Animate a rotating 3D graph in Matplotlib The order of operations is rotation then alignment. Add an '~.axes.Axes' to the figure as part of a subplot arrangement using add_subplot () method. matplotlib.axes.Axes.plot First, let’s import the pyplot and NumPy modules. In single-point annotation we can use matplotlib.pyplot.text and mention the x coordinate of the scatter point and y coordinate + some factor so that text can be distinctly visible from the plot, and then we have to mention the text. Approach: For the subplot, I realize I could flip the x and y data, rotate the axis labels, create a plot title on the left hand side, etc. We use NumPy random module to create some x,y, and z data. seed (19680801) # Compute areas and colors N = 150 r = 2 * np. Matplotlib 3D scatter plot. Use the method, get_test_data to return a tuple X, Y, Z with a test dataset. Syntax: pip3 install ipympl. Displaying rotatable 3D plots in IPython or Jupyter Notebook rand (N) theta = 2 * np. Use scatter method to plot x, y and z data points on 3D axes with depthshade=False. The writer is set to PillowWriter since it’s included by default in matplotlib. (This example is skipped when building the documentation gallery because it intentionally takes a long time to run) How can I rotate a matplotlib plot through 90 degrees? It's a shortcut string notation described in the Notes section below. However, you can use the view_init method to change the view. 3D plotting in Python using matplotlib - Like Geeks