Menyesuaikan plot Anda

Pengantar Visualisasi Data dengan Matplotlib

Ariel Rokem

Data Scientist

Menyesuaikan tampilan data

ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-PRCP-NORMAL"])
plt.show()

Pengantar Visualisasi Data dengan Matplotlib

Menambahkan marker

ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-PRCP-NORMAL"], 
        marker="o")
plt.show()

Pengantar Visualisasi Data dengan Matplotlib

Memilih marker

ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-PRCP-NORMAL"], 
        marker="v")
plt.show()

https://matplotlib.org/api/markers_api.html

Pengantar Visualisasi Data dengan Matplotlib

Mengatur gaya garis

fig, ax = plt.subplots()
ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-TAVG-NORMAL"],
        marker="v", linestyle="--")
plt.show()

Pengantar Visualisasi Data dengan Matplotlib

Menghilangkan garis dengan linestyle

fig, ax = plt.subplots()
ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-TAVG-NORMAL"],
        marker="v", linestyle="None")
plt.show()

Pengantar Visualisasi Data dengan Matplotlib

Memilih warna

fig, ax = plt.subplots()
ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-TAVG-NORMAL"],
        marker="v", linestyle="--", color="r")
plt.show()

Pengantar Visualisasi Data dengan Matplotlib

Menyesuaikan label sumbu

ax.set_xlabel("Waktu (bulan)")
plt.show()

Pengantar Visualisasi Data dengan Matplotlib

Mengatur label sumbu y

ax.set_xlabel("Waktu (bulan)")
ax.set_ylabel("Suhu rata-rata (derajat Fahrenheit)")
plt.show()

Pengantar Visualisasi Data dengan Matplotlib

Menambahkan judul

ax.set_title("Cuaca di Seattle")
plt.show()

Pengantar Visualisasi Data dengan Matplotlib

Latih menyesuaikan plot Anda!

Pengantar Visualisasi Data dengan Matplotlib

Preparing Video For Download...