Figure mpl
subsurfaceio.plot.figure_mpl
Matplotlib backend for express plot specifications.
Classes:
| Name | Description |
|---|---|
MplFigure |
Renders a plot specification with matplotlib, via matplotlib-express. |
Attributes:
| Name | Type | Description |
|---|---|---|
AxisSharing |
TypeAlias
|
Facet axis sharing, as accepted by |
AxisSharing
module-attribute
Facet axis sharing, as accepted by matplotlib.pyplot.subplots.
True is equivalent to 'all' and False to 'none'. Wider than the
Plotly backend, which takes a plain boolean.
MplFigure
pydantic-model
Bases: BaseFigure
Renders a plot specification with matplotlib, via matplotlib-express.
Styling from STYLE_RC is applied for the
duration of plot.
Figures are created through pyplot, which keeps a global reference to every
one of them. In a long-lived process, call close when finished, or use
the figure as a context manager. Figures are deliberately not closed
automatically, because notebook inline display relies on that same global
registry.
Attributes:
| Name | Type | Description |
|---|---|---|
sharex |
AxisSharing
|
Facet x-axis sharing, accepting matplotlib's string forms. |
sharey |
AxisSharing
|
Facet y-axis sharing, accepting matplotlib's string forms. |
Fields:
fig
property
Rendered matplotlib figure.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
When accessed before |
close
Release the figure from the pyplot registry.
The figure object stays usable for saving afterward, but is no longer
reachable through pyplot and no longer displays inline in notebooks.
Idempotent, and a no-op before plot.