[IPython-User] suppress figure rendering in notebook

Fernando Perez fperez.net@gmail....
Tue Jul 24 00:13:42 CDT 2012


On Mon, Jul 16, 2012 at 9:07 AM, Brian Granger <ellisonbg@gmail.com> wrote:
>> A couple of minor warts became apparent, and I am wondering if there is a
>> workaround.  One is that the mpl figure that contains the animation frame is
>> also being displayed inline, so that in addition to the embedded movie, the
>> last frame of the animation is also rendered as an inline mpl figure.  Is
>> there a way to suppress a figure from being rendered?  Conceptually, I'd
>> like to be able to do:
>>
>>     fig = plt.figure();  # semi-colon to suppress rendering
>
> Hmm, the display protocol definitely wasn't designed with this type of
> thing in mind, but we could add it.  Not sure if the semicolon would
> be easy or not.

But John, there's a workaround to avoid the double-display: if you
call plt.close('all') before the end of the cell, then only the one
you display manually will show up.

That's what I use when I do manual displays of figures, and it works
in general well.


More information about the IPython-User mailing list