Can matplotlib add metadata to saved figures?

后端 未结 4 897
青春惊慌失措
青春惊慌失措 2021-01-31 16:53

I want to be able to ascertain the provenance of the figures I create using matplotlib, i.e. to know which version of my code and data created these figures. (See this essay for

4条回答
  •  清酒与你
    2021-01-31 17:02

    As of matplotlib version 2.1.0, the savefig command accepts the keyword argument metadata. You pass in a dictionary with string key/value pairs to be saved.

    This only fully works with certain the 'agg' backend for PNG files.

    For PDF and PS files you can use a pre-defined list of tags.

提交回复
热议问题