Visualization¶
The visualization module provides classes for streamlining the process of creating and updating real-time data visualizations using matolotlib.
- class Visualizable[source]¶
-
Base class for visualizable results.
- create_figure(**kwargs)[source]¶
Create a new figure for plotting.
Returns: Newly generated figure and axes to plot into.
- 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:
- 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.
- 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.
- show()[source]¶
Show this visualization only.
Note that, depending on the visualizuation, this may be a blocking command.
- Return type:
- 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.
- 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.
- 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.
- 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.
- 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.
- class VT¶
Type variable for a visualization.
alias of TypeVar(‘VT’, bound=
Visualization
)
- VAT¶
Type alias for a numpy array of matplotlib axes.
- VLT¶
Type alias for a numpy array of matplotlib lines.