diff --git a/pygal/ghost.py b/pygal/ghost.py index 5dff44f..e7b5704 100644 --- a/pygal/ghost.py +++ b/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()