Generating pairplots on two variables
The pairplot provides a visual representation of the distribution of single variables and the relationship between two variables. The pairplot isn’t just one plot but a group of subplots that display single variables (numerical or categorical) and two variables (numerical-numerical and categorical-numerical). A pairplot combines charts such as histograms, density plots, and scatter plots to represent the variables in the dataset. It provides a simple way to view the distribution and relationship across multiple variables in our dataset.
In this recipe, we will explore how to create pairplots in seaborn
. The pairplot
method in seaborn
can be used for this.
Getting ready
We will work with the Palmer Archipelago (Antarctica) penguin data from Kaggle in this recipe. You can retrieve all the files from the GitHub repository.
How to do it…
We will learn how to create a pairplot using the seaborn
library:
- Import the...