Scatter Plots

Learn the fundamentals of scatter plots, including how to design and use them for data visualizations.

Overview

Scatter plots show the relationship between two variables by plotting every data point into an x-y plane. When we’re interested in bivariate analysis, we construct scatter plots to analyze the relationship between two variables.

Use, customize, and interpret scatter plots

Let’s begin by importing the required libraries pandas, seaborn, and matplotlib. There are two columns in our pandas DataFrame gym_df named time_spent and calories_burned. Let’s create a scatter plot using the sns.scatterplot() function. This function accepts many parameters, but we will only use three here. The first argument is data, where we specify our dataset. The second argument is x, where we specify the variable we want on the x-axis (horizontal line). The third argument is y, ...