0.11.2
  • Gallery
  • Tutorial
  • API
  • Site
      • Introduction
      • Release notes
      • Installing
      • Example gallery
      • Tutorial
      • API reference
      • Citing
      • Archive
  • Page
      • seaborn.FacetGrid.add_legend

seaborn.FacetGrid.add_legend¶

FacetGrid.add_legend(self, legend_data=None, title=None, label_order=None, adjust_subtitles=False, **kwargs)¶

Draw a legend, maybe placing it outside axes and resizing the figure.

Parameters
legend_datadict

Dictionary mapping label names (or two-element tuples where the second element is a label name) to matplotlib artist handles. The default reads from self._legend_data.

titlestring

Title for the legend. The default reads from self._hue_var.

label_orderlist of labels

The order that the legend entries should appear in. The default reads from self.hue_names.

adjust_subtitlesbool

If True, modify entries with invisible artists to left-align the labels and set the font size to that of a title.

kwargskey, value pairings

Other keyword arguments are passed to the underlying legend methods on the Figure or Axes object.

Returns
selfGrid instance

Returns self for easy chaining.

Back to top

© Copyright 2012-2021, Michael Waskom. Created using Sphinx 3.3.1.