[IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook

darcamo at gmail.com darcamo at gmail.com
Mon Jan 5 14:14:56 EST 2015

Call plt.close(self._fig) after savefig and the inline plot should not be
shown. Since you are using the figure only to convert to svg with savefig
and you need to close it to avoid the inline plot, then there is no reason
to keep it as an instance attribute.

It might also be a good idea to disable matplotlib interactive mode by
calling plt.ioff() before creating the figure object and reenabling it
after the figure is closed by calling plt.ion().

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150105/a74c1c65/attachment.html>

More information about the IPython-dev mailing list