plot_utils.py

plot_utils.py gathers the package’s visualization tools. It hosts histogram and a small group of private helpers shared with fit_utils for validation, style management, and consistent behaviour in notebooks.

Main imports

  • Standard library: contextlib.contextmanager, importlib.resources.as_file, importlib.resources.files, typing.TYPE_CHECKING

  • External libraries: numpy as np, numpy.typing.ArrayLike

  • Internal imports: _as_float_vector, standard_deviation

  • Types imported only for annotations: matplotlib.axes.Axes, matplotlib.figure.Figure

What it exports

What it does

  • validate numeric inputs, axis limits, figsize, and textual precision

  • temporarily apply the mespy style, the current rcParams, or another Matplotlib style

  • manage the display of figures created inside IPython/Jupyter notebooks

  • create a new figure or draw on an existing axis

  • optionally show the mean, a one-sigma band, legend, and grid

Related helpers

Detailed page