Skip to content

Instantly share code, notes, and snippets.

@PBarmby
Created July 13, 2017 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PBarmby/deb34b1f859c0ad250945577747e3e63 to your computer and use it in GitHub Desktop.
Save PBarmby/deb34b1f859c0ad250945577747e3e63 to your computer and use it in GitHub Desktop.
Galaxy visualization example
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eteq
Copy link

eteq commented Jul 14, 2017

This is great @PBarmby! At @mwcraig's suggestion, here's a way to render the 3D plot as an interactable version using ipyvolume:

import ipyvolume

fig = ipyvolume.Figure(width=800, height=800)
scats = [ipyvolume.Scatter(x=x.value[early_mask], y=y.value[early_mask], z=z.value[early_mask], 
                           color='red', geo='sphere', size=-Kabs/50),
         ipyvolume.Scatter(x=x.value[~early_mask], y=y.value[~early_mask], z=z.value[~early_mask], 
                           color='blue', geo='sphere', size=-Kabs/50)]
fig.scatters = scats

fig.xlim = fig.ylim = fig.zlim = (-10, 10)
fig

(not the fig at the end is important: without that it never appears in the notebook)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment