Generating box plots for two variables
A boxplot can be used for univariate analysis and bivariate analysis. When analyzing two variables, a boxplot is useful for analyzing numerical-categorical variables. Just like in univariate analysis, the boxplot also gives us a sense of the underlying distribution of a continuous variable through five key metrics. However, in bivariate analysis, the distribution of the continuous variable is displayed across each category of the categorical variable of interest. The five key metrics include the minimum, first quartile, median, third quartile, and maximum. These metrics give insights into the spread of our dataset and possible outliers. The boxplot is explained in more detail in Chapter 4, Performing Univariate Analysis in Python.
In this recipe, we will explore how to create boxplots in seaborn
. The boxplot
method in seaborn
can be used for this.
Getting ready
We will continue working with the Palmer Archipelago (Antarctica) penguin...