arviz_plots.PlotCollection.add_legend#
- PlotCollection.add_legend(dim, aes=None, artist_kwargs=None, title=None, text_only=False, labeller=None, **kwargs)[source]#
Add a legend for the given visual/aesthetic to the plot.
- Parameters:
- dimhashable or iterable of hashable
Dimension or dimensions for which to generate the legend. The pseudo-dimension
__variable__
is allowed too. It should have at least one aesthetic mapped to it. Only the mappings that match will be taken into account; if a legend is requested for the “chain” dimension but there is only one aesthetic mapping for (“chain”, “group”) no legend can be generated.- aes
str
or iterable ofstr
, optional Specific aesthetics to take into account when generating the legend. They should all be mapped to dim. Defaults to all aesthetics matching that mapping with the exception “x” and “y” which are never included.
- artist_kwargsmapping, optional
Keyword arguments passed to the backend visual function used to generate the miniatures in the legend.
- title
str
, optional Legend title. Defaults to dim.
- text_onlybool, optional
If True, creates a text-only legend without graphical markers.
- labeller
labeller
instance
, optional Labeller to generate the legend entries
- position(
int
,int
), default (0, -1) - **kwargsmapping, optional
Keyword arguments passed to the backend function that generates the legend.
- Returns:
- legend
object
The corresponding legend object for the backend of the
PlotCollection
.
- legend
Warning
This method is still in early stages of experimentation and anything beyond the basic usage
add_legend("dim_name")
will probably change in breaking ways.