The FacetGrid is an object that links a Pandas DataFrame to
a matplotlib figure with a particular structure.

In particular, FacetGrid is used to draw plots with multiple
Axes where each Axes shows the same relationship conditioned on
different levels of some variable. It’s possible to condition on up to
three variables by assigning variables to the rows and columns of the
grid and using different colors for the plot elements.

The general approach to plotting here is called “small multiples”,
where the same kind of plot is repeated multiple times, and the
specific use of small multiples to display the same relationship
conditioned on one ore more other variables is often called a “trellis
plot”.

The basic workflow is to initialize the FacetGrid object with
the dataset and the variables that are used to structure the grid. Then
one or more plotting functions can be applied to each subset by calling
FacetGrid.map() or FacetGrid.map_dataframe(). Finally, the
plot can be tweaked with other methods to do things like change the
axis labels, use different ticks, or add a legend. See the detailed
code examples below for more information.

Parameters:

data : DataFrame

Tidy (“long-form”) dataframe where each column is a variable and each
row is an observation.

row, col, hue : strings

Variables that define subsets of the data, which will be drawn on
separate facets in the grid. See the *_order parameters to
control the order of levels of this variable.

col_wrap : int, optional

“Wrap” the column variable at this width, so that the column facets
span multiple rows. Incompatible with a row facet.

share{x,y} : bool, optional

If true, the facets will share y axes across columns and/or x axes
across rows.

size : scalar, optional

Height (in inches) of each facet. See also: aspect.

aspect : scalar, optional

Aspect ratio of each facet, so that aspect*size gives the width
of each facet in inches.

palette : palette name, list, or dict, optional

Colors to use for the different levels of the hue variable. Should
be something that can be interpreted by color_palette(), or a
dictionary mapping hue levels to matplotlib colors.

{row,col,hue}_order : lists, optional

Order for the levels of the faceting variables. By default, this
will be the order that the levels appear in data or, if the
variables are pandas categoricals, the category order.

hue_kws : dictionary of param -> list of values mapping

Other keyword arguments to insert into the plotting call to let
other plot attributes vary across levels of the hue variable (e.g.
the markers in a scatterplot).

legend_out : bool, optional

If True, the figure size will be extended, and the legend will be
drawn outside the plot on the center right.

despine : boolean, optional

Remove the top and right spines from the plots.

margin_titles : bool, optional

If True, the titles for the row variable are drawn to the right of
the last column. This option is experimental and may not work in all
cases.

{x, y}lim: tuples, optional

Limits for each of the axes on each facet (only relevant when
share{x, y} is True.