MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Introduction to Data Visualization with Seaborn

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Change to use relplot() instead of scatterplot()
sns.scatterplot(x="absences", y="G3", 
                data=student_data)

# Show plot
plt.show()
Edit dan Jalankan Kode