Using a lmplot
The lmplot
is used to plot scatter plots with regression lines on FacetGrid objects.
The API is similar to catplot
with the difference that the default behavior
of lmplot
is to plot regression lines.
For the first set of exercises, we will look at the Undergraduate population (UG
) and compare it to the percentage
of students receiving Pell Grants (PCTPELL
).
For the second lmplot
exercise, we can look at the relationships between Average SAT scores and Tuition across the different
degree types and public vs. non-profit schools.
Cet exercice fait partie du cours
Intermediate Data Visualization with Seaborn
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Create a FacetGrid varying by column and columns ordered with the degree_order variable
g = sns.FacetGrid(df, ___="Degree_Type", ____order=degree_ord)
# Map a scatter plot of Undergrad Population compared to PCTPELL
g.map(plt.___, 'UG', 'PCTPELL')
plt.show()
plt.clf()