save_fig
full name:
mplotter.saving.save_fig
type: function
- save_fig(fig, dest=None, close=True, **savefig_kw)[source]
Saves a figure and, optionally, closes it.
The way in which the destination path is specified differs from the one used by
savefig()
. Moreover, if the CWD is in a git repository, attempts to store the commit hash of HEAD in the “Creator” metadata of the file. Supported file formats: ps, eps, pdf, png, svg; (jpeg and tiff via exiftool). Monitoring information is emitted through python’slogging
module.- Parameters:
fig (
Figure
) – The figure to be saved.dest (str or path-like or file-like, default the figure label) – The destination file, or file name (path without extension). If a relative path,
rcParams['savefig.directory']
(default:'~'
) is taken as anchor. The file format (extension to append to path) can be specified viasavefig_kw['format']
and defaults torcParams['savefig.format']
(default:'png'
).close (bool, default True) – Whether to call
matplotlib.pyplot.close()
on the figure after saving.**savefig_kw – Keyword arguments for
savefig()
.
- Returns:
The destination path, with extension.
- Return type: