Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Intermediate Data Visualization with Seaborn

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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()
Code bewerken en uitvoeren