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

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bc6e367
Allow to store metadata in png files
Xarthisius Oct 25, 2016
5200aff
Ensure that metadata pointer is initially set to NULL
Xarthisius Oct 25, 2016
5a5bd96
Allow to pass custom infoDict to images created with pdf backend
Xarthisius Oct 25, 2016
d8cac23
Allow to pass custom metadata to png images created with agg backend
Xarthisius Oct 25, 2016
8305868
Allow to pass custom Creator to images created with ps backend
Xarthisius Oct 25, 2016
0d814e0
'Software' starts with capital letter as per PNG specification
Xarthisius Oct 25, 2016
112e38a
fix pep8 issue
Xarthisius Oct 25, 2016
0f006e3
Drop debug statements
Xarthisius Oct 25, 2016
12b0120
Preserve the default values of the metadata. Allow user to update if …
Xarthisius Oct 25, 2016
d75b068
Revert accidental changes and fix indentation
Xarthisius Oct 27, 2016
92bccd2
Handle unicode/bytes directly in the C extension
Xarthisius Oct 27, 2016
e174284
Use 'latin_1' encoding instead of ascii
Xarthisius Oct 29, 2016
af4c1d1
Fix numpydoc format issues
Xarthisius Oct 29, 2016
98b5587
Add example info dictionary
Xarthisius Oct 29, 2016
a2d2c37
Add a description for the 'metadata' keyword to the docstring
Xarthisius Oct 31, 2016
06ad9fb
Explicitly define 'metadata' kwarg in '_print_figure'
Xarthisius Oct 31, 2016
6916e77
Define 'metadata' as kwarg in _print_figure_tex for consistency
Xarthisius Oct 31, 2016
8bb0ae3
Use default value for invalid key instead of NULL
Xarthisius Oct 31, 2016
66f6e2d
Use OrderedDict for metadata
Xarthisius Nov 17, 2016
8897f0f
Add 'what is new' entry for metadata kwarg in matplotlib.pyplot.savefig
Xarthisius Nov 17, 2016
935e02f
Fix merge
Xarthisius Dec 25, 2016
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
Prev Previous commit
Next Next commit
Add example info dictionary
  • Loading branch information
Xarthisius committed Dec 25, 2016
commit 98b5587b9a6e38fc4eea61d5547820d412a5247d
4 changes: 3 additions & 1 deletion lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2456,7 +2456,9 @@ def __init__(self, filename, keep_empty=True, metadata=None):
when closed.
metadata : dictionary, optional
Information dictionary object (see PDF reference section 10.2.1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find this documentation particularly useful. You could you add at least some examples of metadata ?
Also, numpydoc format requires a space before the column : metadata : dictionary, …

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original parameters all don't have a space before the colon, and rendered fine, so I don't think that's a requirement.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. The current documentation is not rendered properly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, I missed that the bolding is wrong.

'Document Information Dictionary').
'Document Information Dictionary'), e.g.:
`{'Creator': 'My software', 'Author': 'Me',
'Title': 'Awesome fig'}`
"""
self._file = PdfFile(filename, metadata=metadata)
self.keep_empty = keep_empty
Expand Down