MplCurveDrawer#

class MplCurveDrawer[source]#

Curve drawer for MatplotLib backend.

Deprecated since version 0.5: The class qiskit_experiments.curve_analysis.visualization.mpl_drawer.MplCurveDrawer is deprecated as of qiskit-experiments 0.5. It will be removed after 0.6. Plotting and drawing of analysis figures has been moved to the new qiskit_experiments.visualization module.

Attributes

DefaultColors = ((0.12156862745098039, 0.4666666666666667, 0.7058823529411765), (1.0, 0.4980392156862745, 0.054901960784313725), (0.17254901960784313, 0.6274509803921569, 0.17254901960784313), (0.8392156862745098, 0.15294117647058825, 0.1568627450980392), (0.5803921568627451, 0.403921568627451, 0.7411764705882353), (0.5490196078431373, 0.33725490196078434, 0.29411764705882354), (0.8901960784313725, 0.4666666666666667, 0.7607843137254902), (0.4980392156862745, 0.4980392156862745, 0.4980392156862745), (0.7372549019607844, 0.7411764705882353, 0.13333333333333333), (0.09019607843137255, 0.7450980392156863, 0.8117647058823529))#
DefaultMarkers = ('.', 'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X')#
figure#

Return figure object handler to be saved in the database.

In the MatplotLib the Figure and Axes are different object. User can pass a part of the figure (i.e. multi-axes) to the drawer option axis. For example, a user wants to combine two different experiment results in the same figure, one can call pyplot.subplots with two rows and pass one of the generated two axes to each experiment drawer. Once all the experiments complete, the user will obtain the single figure collecting all experimental results.

Note that this method returns the entire figure object, rather than a single axis. Thus, the experiment data saved in the database might have a figure collecting all child axes drawings.

options#

Return the drawing options.

Methods

config()#

Return the config dictionary for this drawing.

Return type:

Dict

draw_confidence_interval(x_data, y_ub, y_lb, name=None, **options)[source]#

Draw confidence interval.

Parameters:
  • x_data (Sequence[float]) – X values.

  • y_ub (Sequence[float]) – The upper boundary of Y values.

  • y_lb (Sequence[float]) – The lower boundary of Y values.

  • name (str | None) – Name of this curve.

  • options – Valid options for the drawer backend API.

draw_fit_line(x_data, y_data, name=None, **options)[source]#

Draw fit line.

Parameters:
  • x_data (Sequence[float]) – X values.

  • y_data (Sequence[float]) – Fit Y values.

  • name (str | None) – Name of this curve.

  • options – Valid options for the drawer backend API.

draw_fit_report(description, **options)[source]#

Draw text box that shows fit reports.

Parameters:
  • description (str) – A string to describe the fiting outcome.

  • options – Valid options for the drawer backend API.

draw_formatted_data(x_data, y_data, y_err_data, name=None, **options)[source]#

Draw the formatted data that is used for fitting.

Parameters:
  • x_data (Sequence[float]) – X values.

  • y_data (Sequence[float]) – Y values.

  • y_err_data (Sequence[float]) – Standard deviation of Y values.

  • name (str | None) – Name of this curve.

  • options – Valid options for the drawer backend API.

draw_raw_data(x_data, y_data, name=None, **options)[source]#

Draw raw data.

Parameters:
  • x_data (Sequence[float]) – X values.

  • y_data (Sequence[float]) – Y values.

  • name (str | None) – Name of this curve.

  • options – Valid options for the drawer backend API.

format_canvas()[source]#

Final cleanup for the canvas appearance.

initialize_canvas()[source]#

Initialize the drawing canvas.

set_options(**fields)#

Set the drawing options. :param fields: The fields to update the options