publiplots.save_multiple

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

Save the same figure in multiple formats.

Convenient function for saving a figure in multiple formats with the same base name (e.g., both PNG for presentations and PDF for publications).

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

  • formats (list, optional) – List of file formats (e.g., [‘png’, ‘pdf’, ‘svg’]). If None, saves as both PNG and PDF.

  • **kwargs (Any) – Additional keyword arguments passed to savefig().

Examples

Save in default formats (PNG and PDF): >>> 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=600)