atomica.plotting.save_figs(figs, path='.', prefix='', fnames=None, file_format='png')[source]

Save figures to disk as PNG or other graphics format files

Functions like plot_series and plot_bars can generate multiple figures, depending on the data and legend options. This function facilitates saving those figures together. The name for the file can be automatically selected when saving figures generated by plot_series and plot_bars. This function also deals with cases where the figure list may or may not contain a separate legend (so saving figures with this function means the legend mode can be changed freely without having to change the figure saving code).

  • figs – A figure or list of figures

  • path – Optionally append a path to the figure file name

  • prefix – Optionally prepend a prefix to the file name

  • fnames – Optionally an array of file names. By default, each figure is named

Return type:


using its ‘label’ property. If a figure has an empty ‘label’ string it is assumed to be a legend and will be named based on the name of the figure immediately before it. If you provide an empty string in the fnames argument this same operation will be carried out. If the last figure name is omitted, an empty string will automatically be added. :type file_format: :param file_format: the file format to save as, default png, allowed formats {png, ps, pdf, svg}