Building a FacetGrid
Seaborn's FacetGrid is the foundation for building data-aware grids. A data-aware grid allows
you to create a series of small plots that can be useful for understanding complex data
relationships.
For these exercises, we will continue to look at the College Scorecard Data from the US Department of Education. This rich dataset has many interesting data elements that we can plot with Seaborn.
When building a FacetGrid, there are two steps:
- Create a
FacetGridobject with columns, rows, or hue. - Map individual plots to the grid.
Diese Übung ist Teil des Kurses
Intermediate Data Visualization with Seaborn
Anleitung zur Übung
- Create a
FacetGridthat shows a point plot of the Average SAT scoresSAT_AVG_ALL. - Use
row_orderto control the display order of the degree types.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Create FacetGrid with Degree_Type and specify the order of the rows using row_order
g2 = sns.____(df,
____="Degree_Type",
row_order=['Graduate', 'Bachelors', 'Associates', 'Certificate'])
# Map a pointplot of SAT_AVG_ALL onto the grid
g2.____(sns.____, 'SAT_AVG_ALL')
# Show the plot
plt.show()
plt.clf()