Pengantar Visualisasi Data dengan Matplotlib
Ariel Rokem
Data Scientist
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot(seattle_weather["MONTH"], seattle_weather["MLY-TAVG-NORMAL"])
ax.plot(austin_weather["MONTH"], austin_weather["MLY-TAVG-NORMAL"])
ax.set_xlabel("Waktu (bulan)")
ax.set_ylabel("Suhu rata-rata (derajat Fahrenheit)")
plt.show()

plt.style.use("ggplot")fig, ax = plt.subplots() ax.plot(seattle_weather["MONTH"], seattle_weather["MLY-TAVG-NORMAL"]) ax.plot(austin_weather["MONTH"], austin_weather["MLY-TAVG-NORMAL"]) ax.set_xlabel("Waktu (bulan)") ax.set_ylabel("Suhu rata-rata (derajat Fahrenheit)") plt.show()

plt.style.use("default")
plt.style.use("bmh")fig, ax = plt.subplots() ax.plot(seattle_weather["MONTH"], seattle_weather["MLY-TAVG-NORMAL"]) ax.plot(austin_weather["MONTH"], austin_weather["MLY-TAVG-NORMAL"]) ax.set_xlabel("Waktu (bulan)") ax.set_ylabel("Suhu rata-rata (derajat Fahrenheit)") plt.show()

plt.style.use("seaborn-colorblind")fig, ax = plt.subplots() ax.plot(seattle_weather["MONTH"], seattle_weather["MLY-TAVG-NORMAL"]) ax.plot(austin_weather["MONTH"], austin_weather["MLY-TAVG-NORMAL"]) ax.set_xlabel("Waktu (bulan)") ax.set_ylabel("Suhu rata-rata (derajat Fahrenheit)") plt.show()

Pengantar Visualisasi Data dengan Matplotlib