Visualization

class ImageVisualization(figure, axes, image)[source]

Bases: Visualization

Information generated by plotting a Visualizable.

Parameters:
  • figure (plt.FigureBase) – The figure containing the plot.

  • axes (VAT) – The individual axes contained within the figure. A numpy object array of shape (nrows, ncols) containing matplotlib axes.

  • image (AxesImage) – The axes image representing the image plot.

property image: AxesImage

The axes image representing the image plot.

class PlotVisualization(figure, axes, lines)[source]

Bases: Visualization

Information generated by plotting a Visualizable.

Parameters:
  • figure (plt.FigureBase) – The figure containing the plot.

  • axes (VAT) – The individual axes contained within the figure. A numpy object array of shape (nrows, ncols) containing matplotlib axes.

  • lines (VLT) – The lines contained within the axes. A numpy object array of shape (nrows, ncols) containing matplotlib lines for each axis.

property lines: Any]

The lines contained within the axes.

class QuadMeshVisualization(figure, axes, mesh)[source]

Bases: Visualization

Information generated by plotting a Visualizable.

Parameters:
  • figure (plt.FigureBase) – The figure containing the plot.

  • axes (VAT) – The individual axes contained within the figure. A numpy object array of shape (nrows, ncols) containing matplotlib axes.

  • mesh (QuadMesh) – The quad mesh representing the image plot.

property mesh: QuadMesh

The mesh representing the image plot.

class ScatterVisualization(figure, axes, paths)[source]

Bases: Visualization

Information generated by plotting a Visualizable.

Parameters:
  • figure (plt.FigureBase | None) – The figure containing the plot. May be None if the figure is unknown or unavailable.

  • axes (VAT) – The individual axes contained within the figure. A numpy object array of shape (nrows, ncols) containing matplotlib axes.

  • paths (PathCollection) – The path collection representing the scatter plot.

property paths: Any]

The path collection representing the scatter plot.

class StemVisualization(figure, axes, container)[source]

Bases: Visualization

Information generated by plotting a Visualizable.

Parameters:
  • figure (plt.FigureBase | None) – The figure containing the plot. May be None if the figure is unknown or unavailable.

  • axes (VAT) – The individual axes contained within the figure. A numpy object array of shape (nrows, ncols) containing matplotlib axes.

  • container (StemContainer) – The container containing the stem plot.

property container: StemContainer

The container containing the stem plot.

VAT

Type alias for a numpy array of matplotlib axes.

VLT

Type alias for a numpy array of matplotlib lines.

class VT

Type variable for a visualization.

alias of TypeVar(‘VT’, bound=Visualization)

class Visualizable[source]

Bases: Generic[VT], ABC

Base class for visualizable results.

create_figure(**kwargs)[source]

Create a new figure for plotting.

Returns: Newly generated figure and axes to plot into.

Return type:

Tuple[FigureBase, NDArray[Shape[*, *], Any]]

update_visualization(visualization=None, **kwargs)[source]

Update an existing visualization with new data.

Parameters:

visualization (VT, optional) – The visualization to update. If not specified, the most recent visualization will be updated.

Raises:

RuntimeError – If no visualization is provided and no visualization is cached.

Return type:

None

visualize(axes=None, *, title=None, **kwargs)[source]

Generate a visual representation of this object using Matplotlib.

Parameters:
  • axes (VAT | plt.Axes, optional) – The Matplotlib axes object into which the information should be plotted. If not specified, the routine will generate and return a new figure.

  • title (str, optional) – Title of the generated plot. If not specified, Visualizable.title will be applied.

Return type:

TypeVar(VT, bound= Visualization)

Returns: Plotted information including axes and lines.

property title: str

Title of the visualizable.

Returns: Title string.

property visualization: VT | None

The most recent visualization.

class VisualizableAttribute[source]

Bases: Generic[VT], Visualizable[VT]

Base class for attributes mocking plot functions.

class Visualization(figure, axes)[source]

Bases: ABC

Information generated by plotting a Visualizable.

Parameters:
  • figure (plt.FigureBase | None) – The figure containing the plot. May be None if the figure is unknown or unavailable.

  • axes (VAT) – The individual axes contained within the figure. A numpy object array of shape (nrows, ncols) containing matplotlib axes.

property axes: Any]

The individual axes contained within the figure.

property figure: Figure | None

The figure containing the plot.