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.
Questo esercizio fa parte del corso
Intermediate Data Visualization with Seaborn
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# 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()