Add support for png_text metadata, allow to customize metadata for other backends. #7349
Merged
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
bc6e367
Allow to store metadata in png files
Xarthisius 5200aff
Ensure that metadata pointer is initially set to NULL
Xarthisius 5a5bd96
Allow to pass custom infoDict to images created with pdf backend
Xarthisius d8cac23
Allow to pass custom metadata to png images created with agg backend
Xarthisius 8305868
Allow to pass custom Creator to images created with ps backend
Xarthisius 0d814e0
'Software' starts with capital letter as per PNG specification
Xarthisius 112e38a
fix pep8 issue
Xarthisius 0f006e3
Drop debug statements
Xarthisius 12b0120
Preserve the default values of the metadata. Allow user to update if …
Xarthisius d75b068
Revert accidental changes and fix indentation
Xarthisius 92bccd2
Handle unicode/bytes directly in the C extension
Xarthisius e174284
Use 'latin_1' encoding instead of ascii
Xarthisius af4c1d1
Fix numpydoc format issues
Xarthisius 98b5587
Add example info dictionary
Xarthisius a2d2c37
Add a description for the 'metadata' keyword to the docstring
Xarthisius 06ad9fb
Explicitly define 'metadata' kwarg in '_print_figure'
Xarthisius 6916e77
Define 'metadata' as kwarg in _print_figure_tex for consistency
Xarthisius 8bb0ae3
Use default value for invalid key instead of NULL
Xarthisius 66f6e2d
Use OrderedDict for metadata
Xarthisius 8897f0f
Add 'what is new' entry for metadata kwarg in matplotlib.pyplot.savefig
Xarthisius 935e02f
Fix merge
Xarthisius
Jump to file
No files or symbols found.
| @@ -0,0 +1,20 @@ | ||
| +Metadata savefig kwarg | ||
| +---------------------- | ||
| + | ||
| +:func:`~matplotlib.pyplot.savefig` now accepts `metadata` as a keyword argument. | ||
| +It can be used to store key/value pairs in the image metadata. | ||
| + | ||
| +Supported formats and backends | ||
| +`````````````````````````````` | ||
| +* 'png' with Agg backend | ||
| +* 'pdf' with PDF backend (see | ||
| + :func:`~matplotlib.backends.backend_pdf.PdfFile.writeInfoDict` for a list of | ||
| + supported keywords) | ||
| +* 'eps' and 'ps' with PS backend (only 'Creator' key is accepted) | ||
| + | ||
| +Example | ||
| +``````` | ||
| +:: | ||
| + | ||
| + plt.savefig('test.png', metadata={'Software': 'My awesome software'}) | ||
| + |
76
src/_png.cpp