Skip to content

Add references to animations in Figure for Animations Persistence #15026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,8 @@ def __init__(self, fig, event_source=None, blit=False):
if self._blit:
self._setup_blit()

fig.animations.append(self)

def _start(self, *args):
'''
Starts interactive animation. Adds the draw frame command to the GUI
Expand Down
3 changes: 3 additions & 0 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ def __init__(self,
# list of child gridspecs for this figure
self._gridspecs = []

# list of animations for this figure
self.animations = []

# TODO: I'd like to dynamically add the _repr_html_ method
# to the figure in the right context, but then IPython doesn't
# use it, for some reason.
Expand Down