Hello,
I would like to display some data in a 3D plot that can then be interactively rotated with the mouse around any of the 3 axis (eg. just like a 3D plot in matlab). Below is a snippet that successfully displays a 3D plot, but unfortunately it is static. According to the matplotlib docs it seems like this should support interactive rotation and zoom from mouse inputs.
Are there some additional configuration steps required to make this plot mouseable? Or do I need to use a different plotting package to achieve interactive rotate/zoom?
%python import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt
def randrange(n, vmin, vmax): return (vmax-vmin)*np.random.rand(n) + vmin
fig = plt.figure() ax = fig.add_subplot(111, projection='3d') n = 100 for c, m, zl, zh in [('r', 'o', -50, -25), ('b', '^', -30, -5)]: xs = randrange(n, 23, 32) ys = randrange(n, 0, 100) zs = randrange(n, zl, zh) ax.scatter(xs, ys, zs, c=c, marker=m)
ax.set_xlabel('X Label') ax.set_ylabel('Y Label') ax.set_zlabel('Z Label')
x = np.linspace(0, 2*np.pi, 50) y = np.sin(x) y2 = y + 0.1 * np.random.normal(size=x.shape)
display(fig)
Thank You!!!
I didn't find the right solution from the Internet.
References
https://forums.databricks.com/questions … otate.html
App Trailer Video Examples