plot3d#
- plot3d(x, y, z, c='index', fig=True, ax=None, returnfig=False, figkwargs=None, axkwargs=None, **kwargs)[source]#
Plot 3D data as a line
- Parameters:
x (arr) – x coordinate data
y (arr) – y coordinate data
z (arr) – z coordinate data
c (str/tuple) – color, can be an array or any of the types accepted by
plt.plot()
; if ‘index’ (default), color by indexfig (fig) – an existing figure to draw the plot in (or set to True to create a new figure)
ax (axes) – an existing axes to draw the plot in
returnfig (bool) – whether to return the figure, or just the axes
figkwargs (dict) –
plt.figure()
axkwargs (dict) –
plt.axes()
kwargs (dict) – passed to
plt.plot()
Examples:
x,y,z = np.random.rand(3,10) sc.plot3d(x, y, z) fig = plt.figure() n = 100 x = np.array(sorted(np.random.rand(n))) y = x + np.random.randn(n) z = np.random.randn(n) c = np.arange(n) sc.plot3d(x, y, z, c=c, fig=fig)
New in version 3.1.0: Allow multi-colored line; removed “plotkwargs” argument; “fig” defaults to True