What is an Lmplot() in Seaborn ? With Example
It is a combination of Scatter Plot and Regression Line.
A regression line is simply a single line that best fits the data (in terms of having the smallest overall distance from the line to the points)
Let’s Start Exploratory Data Analysis on Flights Dataset using Seaborn Library of Python Pandas
import seaborn as sns
flights = sns.load_dataset('flights')
flights
sns.lmplot(x='year', y='passengers', data=flights)
sns.lmplot(x='year', y='passengers', data=flights, hue='month')
sns.lmplot(x='year', y='passengers', data=flights, hue='month', palette='Set2', fit_reg=False)
# Selecting Data for June Only
june = flights[(flights['month']=='June') | (flights['month']=='July') ]
sns.lmplot(x='year', y='passengers', data=june, hue='month', palette='Set2', fit_reg=True)