Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

Visualization (qiskit_experiments.visualization)

The visualization module provides plotting functionality for creating figures from experiment and analysis results. This includes plotter and drawer classes to plot data in CurveAnalysis and its subclasses. Plotters inherit from BasePlotter and define a type of figure that may be generated from experiment or analysis data. For example, the results from CurveAnalysis—or any other experiment where results are plotted against a single parameter (i.e., \(x\))—can be plotted using the CurvePlotter class, which plots X-Y-like values.

These plotter classes act as a bridge (from the common bridge pattern in software development) between analysis classes (or even users) and plotting backends such as Matplotlib. Drawers are the backends, with a common interface defined in BaseDrawer. Though Matplotlib is the only officially supported plotting backend in Qiskit Experiments (i.e., through MplDrawer), custom drawers can be implemented by users to use alternative backends. As long as the backend is a subclass of BaseDrawer, and implements all the necessary functionality, all plotters should be able to generate figures with the alternative backend.

To collate style parameters together, plotters and drawers store instances of the PlotStyle class. These instances can be merged and updated, so that default styles can have their values overwritten.

Plotter Library

BasePlotter(drawer)

An abstract class for the serializable figure plotters.

CurvePlotter(drawer)

A plotter class to plot results from CurveAnalysis.

IQPlotter(drawer)

A plotter class to plot IQ data.

Drawer Library

BaseDrawer()

Abstract class for the serializable Qiskit Experiments figure drawer.

MplDrawer()

Drawer for MatplotLib backend.

Plotting Style

PlotStyle

A stylesheet for BasePlotter and BaseDrawer.