Browse Source

Merge pull request #15 from aebrahim/notebook

add png visualization in ipython notebook
pull/17/merge
Mounier Florian 12 years ago
parent
commit
aed7744996
  1. 4
      pygal/ghost.py

4
pygal/ghost.py

@ -102,3 +102,7 @@ class Ghost(object):
"""Render the graph, convert it to png and write it to filename"""
import cairosvg
return cairosvg.svg2png(bytestring=self.render(), write_to=filename)
def _repr_png_(self):
"""Display png in IPython notebook"""
return self.render_to_png()

Loading…
Cancel
Save