Multivariate analysis with seaborn Grids
Seaborn has the ability to facet multiple plots in a grid. Certain functions in seaborn do not work at the matplotlib axis level, but rather at the figure level. These include catplot
, lmplot
, pairplot
, jointplot
, and clustermap
.
The figure
or grid
functions, for the most part, use the axes
functions to build the grid. The final objects returned from the grid
functions are of grid type, of which there are four different kinds. Advanced use cases necessitate the use of grid types, but the vast majority of the time, you will call the underlying grid
functions to produce the actual Grid and not the constructor itself.
In this recipe, we will examine the relationship between years of experience and salary by gender and race. We will begin by creating a regression plot with a seaborn Axes function and then add more dimensions to the plot with grid
functions.
How to do it…
- Read in the employee dataset, and...