saving
full name:
mplotter.saving
type: module
Saving matplotlib figures to file.
Reproducibility is a key requirement for publishing scientific work.
As far as illustrations are concerned, reproducibility can be achieved
using a VCS to track
changes to the plotting code. When the CWD is in a git repository, the function save_fig()
provided by this
module stores the commit hash of HEAD in the “Creator” metadata of the
saved figure. Some file formats are supported only through exiftool (see SUPPORTED_FORMATS
and
EXIFTOOL_FORMATS
). The metadata can be retrieved e.g. via
exiftool -Creator <filename(s)>
or, for svg files, under the tag
/svg/metadata/RDF/Work/creator/Agent/title
.
Attributes
Default supported file formats for git revision. |
|
Exiftool supported file formats for git revision. |
Functions
|
A context manager for temporarily changing the plotting directory. |
|
Returns a figure's label or, as a fallback, its number. |
|
Saves a figure and, optionally, closes it. |