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.

CurvePlotter.data_for

CurvePlotter.data_for(series_name, data_keys)

Returns data associated with the given series.

The returned tuple contains the data, associated with data_keys, in the same orders as they are provided. For example,

plotter.set_series_data("seriesA", x=data.x, y=data.y, yerr=data.yerr)

# The following calls are equivalent.
x, y, yerr = plotter.data_for("seriesA", ["x", "y", "yerr"])
x, y, yerr = data.x, data.y, data.yerr

# Retrieving a single data key returns a tuple. Note the comma after ``x``.
x, = plotter.data_for("seriesA", "x")

data_for() is intended to be used by sub-classes of BasePlotter when plotting in the _plot_figure() method.

Parameters:
  • series_name (Union[str, int, float]) – The series name for the given series.

  • data_keys (Union[str, List[str]]) – List of data keys for the data to be returned. If a single data key is given as a string, it is wrapped in a list.

Return type:

Tuple[Optional[Any]]

Returns:

A tuple of data associated with the given series, identified by data_keys. If no data has been set for a data key, None is returned for the associated tuple entry.