plot.serialization_matplotlib¶
Serialization of Figure object to matplotlib.
MatplotlibFigureSerializer
¶
Serializer for figures to matplotlib.
to_figure
classmethod
¶
Convert sbmlsim.Figure to matplotlib figure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
experiment
|
Any
|
the experiment the data of the figure is read from,
whose |
required |
figure
|
Figure
|
the figure. |
required |
settings
|
FigureSettings | Mapping[str, Any] | None
|
the settings of the run, a |
None
|
Returns:
| Type | Description |
|---|---|
Figure
|
The matplotlib figure. |
saved_box
¶
Get the box of a figure to save, bbox_inches of savefig.
bbox_inches="tight" draws the whole figure to find the ticks, labels,
legends and titles which reach beyond it, and once more to write it, 15 %
of the time of the simulation experiments of a model. A figure which the
serializer built has its texts measured already and needs no drawing for
its box: the tight box of its artists, measured with _measuring_renderer
and padded by savefig.pad_inches, is the box of "tight" up to the
metrics of the fonts of the format (a fraction of a point). Any other
figure, and one with a layout engine, which lays it out when it is drawn,
is saved "tight".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fig
|
Figure
|
the figure. |
required |
Returns:
| Type | Description |
|---|---|
Bbox | Literal['tight']
|
The box in inches, or |
limit_log_axis
¶
Limit a log axis of matplotlib to LOG_DECADES below its largest value.
The limits of the data drawn so far, see sbmlsim.plot.plotting.log_limits;
for a figure of a model drawn with matplotlib itself, after its data and
set_yscale("log").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ax
|
Axes
|
the axes. |
required |
axis
|
str
|
|
'y'
|
low
|
float | None
|
the lower limit set on the axis, |
None
|
high
|
float | None
|
the upper limit set on the axis, |
None
|
limit_log_axes
¶
Limit every automatic log axis of a figure, see limit_log_axis.
The custom figures of an experiment (figures_mpl) are drawn by the
model; a log axis whose limits it set itself (autoscale off) is kept.