grapa.shared.mpl_figure_factory.MplFigureFactory

class grapa.shared.mpl_figure_factory.MplFigureFactory(use_pyplot: bool = True)

Bases: object

Dispatch selected calls to pyplot or OO Matplotlib based on a flag. Feel free to use figure.add_axes, add_subplot, ax.plot, fig.savefig etc.

__init__(use_pyplot: bool = True) None

Methods

__init__([use_pyplot])

close([fig])

Close a pyplot-managed figure, or clear the figure if not pyplot

figure(*args, **kwargs)

Create a figure via pyplot (if enabled) or via Figure() otherwise.

close(fig: Figure | None = None) None

Close a pyplot-managed figure, or clear the figure if not pyplot

figure(*args: Any, **kwargs: Any) Figure

Create a figure via pyplot (if enabled) or via Figure() otherwise.