_style_context
Signature
_style_context(style: str | None)
What problem it solves
Applies a temporary Matplotlib style and keeps the behaviour of figures created by mespy consistent, especially in IPython/Jupyter notebooks.
Input contract
style=Nonedoes not add any extra style and leaves the currentrcParamsin effect.style="mespy"loads the style file bundled with the package.Any other string is passed to Matplotlib as a style name.
Where it is used
How it fails
If Matplotlib cannot load the requested style, it propagates the error raised by the underlying style backend.
In notebook environments, at the end of the block it shows the new figures that were created and then closes them to avoid double automatic display.
Why it remains private
It is an infrastructural detail shared by the plotting functions. Documenting it clarifies the package behaviour, but it is not intended as a stable public interface.