save_fig()

Save a matplotlib figure to a file.

Usage

Source

save_fig(
    fig, path, fig_id, tight_layout=False, fig_extension="pdf", resolution=300
)

fig : Figure The figure to save. path : Path The path for saving the figure. fig_id : str The name of the saved figure. tight_layout : bool, optional Whether to use tight layout (default is True). fig_extension : str, optional The file extension for the saved figure (default is ‘pdf’). resolution : int, optional The resolution of the saved figure in dpi (default is 300).

None Saves the figure in the specified format.