Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e87b19

Browse files
authored
Merge pull request #13229 from anntzer/animation_init
MNT: Prevent exception when running animation on Agg backend.
2 parents 010f2f4 + 1b81a08 commit 4e87b19

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/matplotlib/animation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,7 @@ def __init__(self, fig, func, frames=None, init_func=None, fargs=None,
16131613
else:
16141614
self._args = ()
16151615
self._func = func
1616+
self._init_func = init_func
16161617

16171618
# Amount of framedata to keep around for saving movies. This is only
16181619
# used if we don't know how many frames there will be: in the case
@@ -1644,7 +1645,7 @@ def __init__(self, fig, func, frames=None, init_func=None, fargs=None,
16441645
# As a workaround, convert save_count to a native python int.
16451646
self.save_count = int(self.save_count)
16461647

1647-
self._init_func = init_func
1648+
self._cache_frame_data = cache_frame_data
16481649

16491650
# Needs to be initialized so the draw functions work without checking
16501651
self._save_seq = []
@@ -1655,8 +1656,6 @@ def __init__(self, fig, func, frames=None, init_func=None, fargs=None,
16551656
# for a single frame from init, which is not what we want.
16561657
self._save_seq = []
16571658

1658-
self._cache_frame_data = cache_frame_data
1659-
16601659
def new_frame_seq(self):
16611660
# Use the generating function to generate a new frame sequence
16621661
return self._iter_gen()

0 commit comments

Comments
 (0)