draw() in Figure does not obey get_animated()

This could be intentional…I don’t know much about the history of matplotlib, so it’s hard to guess at these things. Anyway, the figure container does not care about the “animated” state of its artists when it does its drawing.

To fix this, in the Figure.draw routine (in figure.py), add the following line just before dsu.sort():

dsu = [x for x in dsu if not x[1].im_self.get_animated()]

···


Daniel Hyams
dhyams@…149…

This looks like it might fail for composite images, where the draw
method is not an Artist method, so im_self will not be defined. Eg in
figimage_demo.py where "fig.suppressComposite = False" since the draw
method is the local function "draw_composite'. To handle
this case as well, I submitted a slightly more verbose pull request at

https://github.com/matplotlib/matplotlib/pull/528

JDH

···

On Fri, Oct 14, 2011 at 9:11 PM, Daniel Hyams <dhyams@...149...> wrote:

This could be intentional...I don't know much about the history of
matplotlib, so it's hard to guess at these things. Anyway, the figure
container does not care about the "animated" state of its artists when it
does its drawing.
To fix this, in the Figure.draw routine (in figure.py), add the following
line just before dsu.sort():
dsu = [x for x in dsu if not x[1].im_self.get_animated()]