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.
BaseDrawer.label_for¶
- BaseDrawer.label_for(name, label)[source]¶
Get the legend label for the given series, with optional overrides.
This method determines the legend label for a series, with optional overrides
label
and the"label"
entry in theseries_params
option (seeoptions
).label
is returned if it is notNone
, as this is the override with the highest priority. If it isNone
, then the drawer will look for a"label"
entry inseries_params
, for the series identified byname
. If this entry doesn’t exist, or isNone
, thenname
is used as the label. If all these options areNone
, thenNone
is returned; signifying that a legend entry for the provided series should not be generated. Note thatlabel_for()
will convertname
tostr
when it is returned.- Parameters:
name (
Union
[str
,int
,float
,None
]) – The name of the series.label (
Union
[str
,int
,float
,None
]) – Optional label override.
- Return type:
Optional
[str
]- Returns:
The legend entry label, or
None
.