trnslator.energyseries.save_and_show

trnslator.energyseries.save_and_show(fig, ax, save, show, close, filename, file_format, dpi, axis_off, extent)[source]

Save a figure to disk and show it, as specified.

Parameters
  • fig (matplotlib.figure.Figure) – the figure

  • ax (matplotlib.axes.Axes or list(matplotlib.axes.Axes)) – the axes

  • save (bool) – whether to save the figure to disk or not

  • show (bool) – whether to display the figure or not

  • close (bool) – close the figure (only if show equals False) to prevent display

  • filename (string) – the name of the file to save

  • file_format (string) – the format of the file to save (e.g., ‘jpg’, ‘png’, ‘svg’)

  • dpi (int) – the resolution of the image file if saving (Dots per inch)

  • axis_off (bool) – if True matplotlib axis was turned off by plot_graph so constrain the saved figure’s extent to the interior of the axis

  • extent

Returns

(tuple) fig, ax