Analyzing two variables using a scatter plot
A scatter plot clearly represents the relationship between two numerical variables. The numerical variables are plotted on the x and y axes, and the values plotted typically reveal a pattern. This pattern on a scatter plot can provide insights into the strength and direction of the relationship between the two variables. This could either be positive (i.e., as one variable increases, the other variable increases) or negative (i.e., as one variable increases, the other variable decreases). Figure 5.1 demonstrates this further:
Figure 5.1: An illustration of a scatterplot
In this recipe, we will explore how to create scatter plots in seaborn
. The scatterplot
method in seaborn
can be used for this.
Getting ready
We will work with only one dataset in this chapter: The Palmer Archipelago (Antarctica) penguin data from Kaggle.
Create a folder for this chapter and create a new Python script or Jupyter Notebook...