May 17, 2018

Playing with 3D interactive scatter plots

Turns out you can do this using ipython widgets + ipyvolume.

Best example:

- Playing with particle data (

All of this looks kind of wobbly / new and a bit useless, but it works, is free and fast.

I was also trying to assing each point a colour like here

But in the end a much more simple approach just worked

fig = ipv.figure()

N = len(hits.volume_id.unique())
cmap ="tab20", N)
colors = cmap(np.linspace(0, 1.0, N))
colors = ["#%02x%02x%02x" % tuple([int(k*255) for k in matplotlib.colors.to_rgb(color)[:3]]) for color in colors]

for i in range(0,N):
hits_v = hits[hits.volume_id == list(hits.volume_id.unique())[i]]
scatter = ipv.scatter(hits_v.x, hits_v.y, hits_v.z, marker="diamond", size=0.1, color=colors[i])

Like this post or have something to say => tell us more in the comments or donate!