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.
MplDrawer.label_for¶
- MplDrawer.label_for(name, label)¶
Get the legend label for the given series, with optional overrides.
This method determines the legend label for a series, with optional overrides
labeland the"label"entry in theseries_paramsoption (seeoptions).labelis 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, thennameis used as the label. If all these options areNone, thenNoneis returned; signifying that a legend entry for the provided series should not be generated. Note thatlabel_for()will convertnametostrwhen 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.