publiplots.save_multiple

publiplots.save_multiple(basename, formats=None, **kwargs)[source]

Save the same figure in multiple formats.

Convenience wrapper around savefig() for saving a figure in several formats with a shared base name (e.g., PNG for presentations and PDF for publications). Each format inherits publiplots’ savefig defaults, including bbox_inches=None.

Parameters:
  • basename (str) – Base filename without extension (e.g., 'figure1').

  • formats (list of str, optional) – File formats (e.g., ['png', 'pdf', 'svg']). If None, saves as both PNG and PDF.

  • **kwargs (Any) – Forwarded to savefig().

Examples

Save in default formats (PNG and PDF):

>>> import publiplots as pp
>>> pp.save_multiple('results/figure1')

Save in custom formats:

>>> pp.save_multiple('figure1', formats=['png', 'svg', 'eps'])

Save with custom DPI:

>>> pp.save_multiple('figure1', formats=['png'], dpi=1200)

See also

savefig

Save a single figure with publiplots defaults.