- Home /

I am new to the Databricks platform. 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 pltdef 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)

thanks

tim

Comment

Plot Warning "Only showing the first ten series" -- Is this configurable? 2 Answers

How can I use Bokeh and Plotly inside databricks? 5 Answers

how to use display() on a table 1 Answer

display world map is showing only US 1 Answer

matplotlib 1 Answer

Databricks Inc.

160 Spear Street, 13th Floor

San Francisco, CA 94105

info@databricks.com

1-866-330-0121

- Anonymous
- Sign in
- Create
- Ask a question
- Create an article
- Explore
- Topics
- Questions
- Articles
- Badges