gemseo / utils

matplotlib_figure module

Services for handling Matplotlib figures, e.g. save and show.

gemseo.utils.matplotlib_figure.save_show_figure(fig, show, file_path, fig_size=None)[source]

Save or show a Matplotlib figure.

Parameters
  • fig (Figure) – The Matplotlib figure to be saved or shown.

  • show (bool) – If True, display the Matplotlib figure.

  • file_path (str | Path) – The file path to save the Matplotlib figure. If None, do not save the figure.

  • fig_size (tuple[float, float] | None) –

    The width and height of the figure in inches, e.g. (w, h). If None, use the current size of the figure.

    By default it is set to None.

Return type

None