Skip to content

Commit 053bd76

Browse files
authored
Merge pull request matplotlib#7207 from efiring/try_animation_context_v2
BUG: 'saving' context manager now passes all args, kw to setup.
2 parents dd589b3 + 137fd6d commit 053bd76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/animation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def frame_size(self):
169169
width_inches, height_inches = self.fig.get_size_inches()
170170
return width_inches * self.dpi, height_inches * self.dpi
171171

172-
def setup(self, fig, outfile, dpi, *args):
172+
def setup(self, fig, outfile, dpi):
173173
'''
174174
Perform setup for writing the movie file.
175175
@@ -190,14 +190,14 @@ def setup(self, fig, outfile, dpi, *args):
190190
self._run()
191191

192192
@contextlib.contextmanager
193-
def saving(self, *args):
193+
def saving(self, *args, **kw):
194194
'''
195195
Context manager to facilitate writing the movie file.
196196
197-
``*args`` are any parameters that should be passed to `setup`.
197+
``*args, **kw`` are any parameters that should be passed to `setup`.
198198
'''
199199
# This particular sequence is what contextlib.contextmanager wants
200-
self.setup(*args)
200+
self.setup(*args, **kw)
201201
yield
202202
self.finish()
203203

0 commit comments

Comments
 (0)