MPL_Figure#
- class vispipe.plot_backend.MPL_Figure(id=None, fig=None, ax=None, subplots=None, title=None, layout='compressed', figsize=None, subplots_kw={}, legend=False)#
Matplotlib backend used by vispipe.
- Parameters:
id (int | str, optional) – Identifier for the figure. Will be used in the future.
fig (matplotlib.figure.Figure | None, default=None) – A matplotlib figure. If fig==None and ax==None plt.subplots() is called .
ax (Axes | Iterable | None, default=None) – Axes or collection of Axes.
subplots (tuple[int,int], optional) – If not None, it is unpacked and used for nrows and ncols for plt.subplots().
title (str, optional) – If not None, it will be used by self._fig.suptitle(title).
layout ({'constrained', 'compressed', 'tight', 'none', LayoutEngine, None}, default='compressed') – Layout of self._fig.
figsize (tuple[float,float] | None, default=None) – Used for figsize plt.subplots().
subplots_kw (dict, optional) – Other keyword arguments used by plt.subplots().
legend (bool | dict, optional) – Toggles legends for the plot. The keyword argument label must be passed to the plot, otherwise the legend is ignored. If a dict is passed then legend is used as keyword arguments for ax.legend().
- property figure#
The Figure used for the plot.
- property subfigs#
The Axes for the plot.
- gca()#
Returns the current axis being used.
- Return type:
Axes
- sca(ax)#
Sets the the provided axis to be the current axis.
- return_fig()#
Returns the the figure and the axes.
- Return type:
tuple[Figure,ndarray]
Plotters#
Built in plotting methods.
|
Calls ax.plot() |
|
Calls ax.scatter() |
|
Call ax.triplot() |
|
Calls ax.contour() or ax.contourf(). |
|
Calls ax.tricontour() or ax.tricontourf(). |
|
Calls ax.hist(). |
Figure Options#
Methods for changing The figure parameters.
Returns the title of the figure as a str. |
|
|
Sets the title of the figure. |
|
Gets the title of an axis. |
|
Sets the lable for an axis. |
|
Returns the label of the xaxis of the current or specified axis. |
|
Sets the label of the xaxis. |
|
Returns the label of the yaxis of the current or specified axis. |
|
Sets the label of the yaxis. |
|
Sets the xticks. |
|
Sets the yticks. |
|
Sets relative spacing of y to x data. |
|
Sets grid lines for the axis |
|
Returns the xlim and ylim of the axis. |
|
Sets the xlim and ylim of the plot. |
|
Calls ax.set() |
|
|
|
Calls plt.colorbar(). |
|
Calls fig.savefig(). |