helper module

Define types and helpers for the visualization library.

create_fig_if_not_exists(axnum: int | list[int] | range, sharex: bool = False, num: int = 1, clean_fig: bool = False, **kwargs) tuple[Figure, list[Axes]]

Check if figures were already created, create it if not.

Parameters:
  • axnum (int | list[int] | range) – Axes indexes as understood by Figure.add_subplot, or number of desired axes.

  • sharex (bool, optional) – If x axis should be shared. The default is False.

  • num (int, optional) – Fig number. The default is 1.

  • clean_fig (bool, optional) – If the previous plot should be erased from Figure. The default is False.

clean_figures(fig_ids: Sequence[int | str | Figure | SubFigure]) None

Clean axis of Figs in fignumlist.

clean_axes(ax_ids: Sequence[Axes]) None

Clean given axis.

remove_artists(axe: Axes) None

Remove lines and plots, but keep labels and grids.

savefig(fig: Figure, filepath: Path) None

Save the figure.