gemseo / utils

matplotlib_figure module

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

Functions:

save_show_figure(fig, show, file_path[, ...])

Save or show a Matplotlib figure.

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

Save or show a Matplotlib figure.

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

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

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

  • fig_size (Optional[Tuple[float, float]]) –

    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