[IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook
Julien Schueller
schueller at phimeca.com
Tue Jan 6 04:20:52 EST 2015
----- Mail original -----
> De: darcamo at gmail.com
> À: "IPython developers list" <ipython-dev at scipy.org>
> Envoyé: Lundi 5 Janvier 2015 20:14:56
> Objet: Re: [IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook
>
> 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().
>
> --
> Darlan
>
That was it, thanks!
More information about the IPython-dev
mailing list