Plotting
Plotting utilities.
Import as:
covvfit.plotting._grid.ArrangedGrid
dataclass
A two-dimensional grid of axes.
Attrs
fig: Matplotlib figure.
one-dimensional array of active axes,
with length equal to the number of active plots
axes_grid: two-dimensional array of all axes.
Note
The number of plots in axes_grid
is typically
greater than the one in axes
, as axes_grid
contains also the axes which are not active
map(self, func, arguments=None)
Applies a function to each active plotting axis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func |
Union[Callable[[matplotlib.axes._axes.Axes], NoneType], Callable[[matplotlib.axes._axes.Axes, Any]]] |
function to be applied. It can have
signature func(ax: plt.Axes)
if If |
required |
covvfit.plotting._grid.arrange_into_grid(nplots, ncols=2, axsize=(2.0, 1.0), **kwargs)
Builds an array of plots to accommodate the axes listed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nplots |
int |
number of plots |
required |
ncols |
int |
number of columns |
2 |
axsize |
tuple |
axis size |
(2.0, 1.0) |
kwargs |
keyword arguments to be passed to
|
{} |
covvfit.plotting._grid.set_axis_off(ax, i=0, j=0)
Hides the axis.
Timeseries submodule
Import as
covvfit.plot.timeseries.plot_fit(ax, ts, y_fit, *, colors, variants=None, linestyle='-', **kwargs)
Function to plot fitted values with customizable line type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ax |
matplotlib.axes |
The axis to plot on. |
required |
ts |
array-like |
Time series data. |
required |
y_fit |
array-like |
Fitted values for each variant. |
required |
variants |
list |
List of variant names. |
None |
colors |
list |
List of colors for each variant. |
required |
linestyle |
str |
Line style for plotting (e.g., '-', '--', '-.', ':'). |
'-' |