Şekillerinizi başkalarıyla paylaşmaya hazırlama

Matplotlib ile Veri Görselleştirmeye Giriş

Ariel Rokem

Data Scientist

Grafik stilini değiştirme

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("Zaman (ay)")
ax.set_ylabel("Ortalama sıcaklık (Fahrenheit derece)")
plt.show()

Matplotlib ile Veri Görselleştirmeye Giriş

Bir stil seçme

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("Zaman (ay)") ax.set_ylabel("Ortalama sıcaklık (Fahrenheit derece)") plt.show()

Matplotlib ile Veri Görselleştirmeye Giriş

Varsayılana dönme

plt.style.use("default")
Matplotlib ile Veri Görselleştirmeye Giriş

Kullanılabilir stiller

Matplotlib ile Veri Görselleştirmeye Giriş

"bmh" stili

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("Zaman (ay)") ax.set_ylabel("Ortalama sıcaklık (Fahrenheit derece)") plt.show()

Matplotlib ile Veri Görselleştirmeye Giriş

Seaborn stilleri

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("Zaman (ay)") ax.set_ylabel("Ortalama sıcaklık (Fahrenheit derece)") plt.show()

Matplotlib ile Veri Görselleştirmeye Giriş

Çizim stili seçme yönergeleri

  • Koyu arka planlar genelde daha az okunur
  • Renk önemliyse, renk körü dostu seçenekleri düşünün
    • "seaborn-colorblind" veya "tableau-colorblind10"
  • Birinin şekli yazdıracağını düşünüyorsanız, daha az mürekkep kullanın
  • Siyah-beyaz basılacaksa, "grayscale" stilini kullanın
Matplotlib ile Veri Görselleştirmeye Giriş

Size uygun stili seçme alıştırması

Matplotlib ile Veri Görselleştirmeye Giriş

Preparing Video For Download...