Creating subplots with col and row
We've seen in prior exercises that students with more absences ("absences"
) tend to have lower final grades ("G3"
). Does this relationship hold regardless of how much time students study each week?
To answer this, we'll look at the relationship between the number of absences that a student has in school and their final grade in the course, creating separate subplots based on each student's weekly study time ("study_time"
).
Seaborn has been imported as sns
and matplotlib.pyplot
has been imported as plt
.
This exercise is part of the course
Introduction to Data Visualization with Seaborn
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Change to use relplot() instead of scatterplot()
sns.scatterplot(x="absences", y="G3",
data=student_data)
# Show plot
plt.show()