Scatter3d

Title
Scatter3D Element
Dependencies
Matplotlib
Backends
Matplotlib
In [1]:
import numpy as np
import holoviews as hv
hv.extension('matplotlib')

Scatter3D represents three-dimensional coordinates which may be colormapped or scaled in size according to a value. They are therefore very similar to Points and Scatter types but have one additional coordinate dimension. Like other 3D elements the camera angle can be controlled using azimuth , elevation and distance plot options:

In [2]:
%%opts Scatter3D [azimuth=40 elevation=20 color_index=2] (s=50 cmap='fire')
y,x = np.mgrid[-5:5, -5:5] * 0.1
heights = np.sin(x**2+y**2)
hv.Scatter3D(zip(x.flat,y.flat,heights.flat))
Out[2]:

Just like all regular 2D elements, Scatter3D types can be overlaid and will follow the default color cycle:

In [3]:
%%opts Scatter3D [size_index='Size' scaling_factor=5] (marker='^')
hv.Scatter3D(np.random.randn(100,4), vdims=['Size']) * hv.Scatter3D(np.random.randn(100,4)+2, vdims=['Size'])
Out[3]:

Download this notebook from GitHub (right-click to download).