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

Skip to content

Commit b8f2e7c

Browse files
committed
BUG : instantiate fall-back writer
fixes #2651 If the a string is passed into save as `writer` the code tries to look up a writer with that name and create it. If a writer with that name is not in the registry, it is replaced with the name of the first writer that _is_ in the registry, but not an instance of that type.
1 parent da6cc34 commit b8f2e7c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/matplotlib/animation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,9 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
702702
warnings.warn("MovieWriter %s unavailable" % writer)
703703

704704
try:
705-
writer = writers.list()[0]
705+
writer = writers[writers.list()[0]](fps, codec, bitrate,
706+
extra_args=extra_args,
707+
metadata=metadata)
706708
except IndexError:
707709
raise ValueError("Cannot save animation: no writers are "
708710
"available. Please install mencoder or "

0 commit comments

Comments
 (0)