Multi-Plots in Seaborn
In the previous topic, we introduced a multi-plot, namely, the pair plot. In this topic, we want to talk about a different way to create flexible multi-plots.
FacetGrid
The FacetGrid is useful for visualizing a certain plot for multiple variables separately. A FacetGrid can be drawn with up to three dimensions: row
, col
, and hue
. The first two have the obvious relationship with the rows and columns of an array. The hue
is the third dimension and is shown in different colors. The FacetGrid
class has to be initialized with a DataFrame, and the names of the variables that will form the row, column, or hue dimensions of the grid. These variables should be categorical or discrete.
The seaborn.FacetGrid(data, row, col, hue, …)
command initializes a multi-plot grid for plotting conditional relationships.
Here are some interesting parameters:
data
: A tidy ("long-form") DataFrame where each column corresponds to a variable, and each...