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#


An abstract class for the serializable figure plotters.


A plotter class to plot results from CurveAnalysis.


A plotter class to plot IQ data.

Drawer Library#


Abstract class for the serializable Qiskit Experiments figure drawer.


Drawer for MatplotLib backend.

Plotting Style#


A stylesheet for BasePlotter and BaseDrawer.