Apart from the methods scatterplot and regplot, seaborn also provides lmplot as another function to draw a scatterplot.
However when we create scatter plots using seaborn’s lmplot, it will introduce a regression line in the plot.
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()
Then lets use the below code to draw lmplot.
sns.lmplot(x='Area', y='Price', data=df)
Note that lmplot produces a regression line in the graph as shown above.