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

Skip to content

Commit 422f1ce

Browse files
committed
Explicitly define 'metadata' kwarg in '_print_figure'
1 parent 95e0a7a commit 422f1ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ def _print_ps(self, outfile, format, *args, **kwargs):
979979

980980
def _print_figure(self, outfile, format, dpi=72, facecolor='w', edgecolor='w',
981981
orientation='portrait', isLandscape=False, papertype=None,
982-
**kwargs):
982+
metadata=None, **kwargs):
983983
"""
984984
Render the figure to hardcopy. Set the figure patch face and
985985
edge colors. This is useful because some of the GUIs have a
@@ -992,6 +992,9 @@ def _print_figure(self, outfile, format, dpi=72, facecolor='w', edgecolor='w',
992992
993993
If outfile is a file object, a stand-alone PostScript file is
994994
written into this file object.
995+
996+
metadata must be a dictionary. Currently, only the value for
997+
the key 'Creator' is used.
995998
"""
996999
isEPSF = format == 'eps'
9971000
passed_in_file_object = False
@@ -1074,7 +1077,6 @@ def write(self, *kl, **kwargs):
10741077
self.figure.set_edgecolor(origedgecolor)
10751078

10761079
# check for custom metadata
1077-
metadata = kwargs.pop("metadata", None)
10781080
if metadata is not None and 'Creator' in metadata:
10791081
creator_str = metadata['Creator']
10801082
else:

0 commit comments

Comments
 (0)