Though we have an obvious method named, scatterplot, provided by seaborn to draw a scatterplot, seaborn provides other methods as well to draw scatter plot. One of the other method is regplot.
However when we create scatter plots using seaborn’s regplot method, it will introduce a regression line in the plot as regplot is based on regression by default.
Let us first import libraries and load the data required to create the plot.
import numpy as np import pandas as pd import seaborn as sns df = pd.read_csv('Seaborn-ScatterPlot-Data.csv') df.head()
After loading the data we can use the below code to draw the scatter plot.
sns.regplot(x='Area', y='Price', data=df)
Note the regression line in the plot generated above.