dynamo.pl.save_fig(path=None, prefix=None, dpi=None, ext='pdf', transparent=True, close=True, verbose=True)[source]

Save a figure from pyplot.

Code adapated from http://www.jesshamrick.com/2012/09/03/saving-figures-from-pyplot/

  • path (Optional[str]) – the path (and filename, without the extension) to save_fig the figure to. Defaults to None.

  • prefix (Optional[str]) – the prefix added to the figure name. This will be automatically set accordingly to the plotting function used. Defaults to None.

  • dpi (Optional[int]) – the resolution in dots per inch. If None, defaults to rcParams[“savefig.dpi”]. If ‘figure’, uses the figure’s dpi value. Defaults to None.

  • ext (str) – the file extension. This must be supported by the active matplotlib backend (see matplotlib.backends module). Most backends support ‘png’, ‘pdf’, ‘ps’, ‘eps’, and ‘svg’. Defaults to “pdf”.

  • transparent (bool) – whether to save the figure with axes patches and background transparent. Defaults to True.

  • close (bool) – whether to close the figure after saving. If you want to save_fig the figure multiple times (e.g., to

  • formats) (multiple) –

  • True. (you should NOT close it in between saves or you will have to re-plot it. Defaults to) –

  • verbose (bool) – whether to print information about when and where the image has been saved. Defaults to True.

Return type: