0

I'm creating a 3D scatter plot using matplotlib and would like to interact with it in jupyter notebook by panning and zooming. However, when I try to use the zoom button on the interactive plot, it acts the same way as the pan button. Is there a way to zoom on interactive 3D plots in jupyter notebook? Here's a MWE that reproduces the issue for me:

import matplotlib.pyplot as plt
import numpy as np
%matplotlib notebook

np.random.seed(1000)

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

N = 100

ax.scatter(np.random.rand(N), np.random.rand(N), np.random.rand(N), '.')
Eney
  • 55
  • 6

1 Answers1

0

The pan and zoom buttons in matplotlib 3D plots do not work at the moment, but should hopefully be enabled in matplotlib version 3.7 (if this PR gets merged in). In the meantime, if you are using a mouse you should be able to rotate 3D plots with the left mouse button, pan using the middle mouse button, and zoom using the right mouse button.

Scott
  • 504
  • 6
  • 17