Skip to content

Instantly share code, notes, and snippets.

@rpmuller
Last active January 23, 2019 05:53
IPython's SVG display functionality, in conjunction with the ease of making SVG strings using ElementTrees, makes it really easy to have a nice drawing canvas inside of IPython.
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Carreau
Copy link

Carreau commented Jun 5, 2013

may I suggest adding a _repr_svg_ to Scene ?

@rpmuller
Copy link
Author

@Carreau - great idea. Done!

@ohlr
Copy link

ohlr commented Nov 20, 2018

To get it working with Jupyter + Python 3.6 I had to do the following:
return "#%x%x%x" % (int(rgb[0]/16),int(rgb[1]/16),int(rgb[2]/16))
SVG(scene.to_svg())

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