Python Eğitimi

Python ANA SAYFA Python Tanıtımı Python Başlarken Python Sözdizimi Python Yorumları Python Değişkenleri Python Veri Türleri Python Numaraları Python Döküm Python Dizeleri Python Boole'leri Python Operatörleri Python Listeleri piton demetleri Python Setleri Python Sözlükleri Python Eğer... Başka Python while Döngüleri Döngüler için Python Python Fonksiyonları piton lambda Python Dizileri Python Sınıfları/Nesneleri Python Kalıtımı Python Yineleyiciler Python Kapsamı Python Modülleri Python Tarihleri Python Matematik Python JSON'u Python Normal İfade Python PIP'si Python Deneyin... Hariç Python Kullanıcı Girişi Python Dize Biçimlendirme

Dosya yönetimi

Python Dosya İşleme Python Okuma Dosyaları Python Dosyaları Yazma/Oluşturma Python Dosyaları Sil

Python Modülleri

NumPy Eğitimi Panda İzlenecek Yol Scipy Eğitimi

Python Matplotlib'i

Matplotlib'e Giriş Matplotlib Başlarken Matplotlib Pyplot Matplotlib Çizimi Matplotlib İşaretçileri Matplotlib Hattı Matplotlib Etiketleri Matplotlib Izgarası Matplotlib Alt Noktaları Matplotlib Dağılımı Matplotlib Çubukları Matplotlib Histogramları Matplotlib Pasta Grafikleri

Makine öğrenme

Başlarken Ortalama Medyan Modu Standart sapma Yüzdelik Veri Dağıtımı Normal Veri Dağılımı Dağılım grafiği Doğrusal Regresyon Polinom Regresyon Çoklu regresyon Ölçek Tren/Test Karar ağacı

Python MySQL

MySQL'e Başlayın MySQL Veritabanı Oluştur MySQL Tablo Oluştur MySQL Ekle MySQL Seçimi MySQL Nerede MySQL Sıralaması MySQL Sil MySQL Bırakma Tablosu MySQL Güncellemesi MySQL Sınırı MySQL'e Katılma

Python MongoDB

MongoDB Başlarken MongoDB Veritabanı Oluştur MongoDB Koleksiyon Oluştur MongoDB Ekle MongoDB Bul MongoDB Sorgusu MongoDB Sıralaması MongoDB Sil MongoDB Damla Koleksiyonu MongoDB Güncellemesi MongoDB Sınırı

Python Referansı

Python'a Genel Bakış Python Yerleşik İşlevleri Python Dizisi Yöntemleri Python Liste Yöntemleri Python Sözlük Yöntemleri Python Tuple Yöntemleri Python Kümesi Yöntemleri Python Dosya Yöntemleri Python Anahtar Kelimeleri Python İstisnaları Python Sözlüğü

Modül Referansı

Rastgele Modül İstek Modülü İstatistik Modülü Matematik Modülü cMath Modülü

Python Nasıl Yapılır?

Liste Kopyalarını Kaldır Bir Dizeyi Ters Çevir İki Sayı Ekle

Python Örnekleri

Python Örnekleri Python Derleyici Python Alıştırmaları Python Testi Python Sertifikası

Matplotlib Alt Noktaları


Çoklu Grafikleri Görüntüle

İşlev ile subplots()tek bir şekilde birden fazla grafik çizebilirsiniz:

Örnek

2 arsa çizin:

import matplotlib.pyplot as plt
import numpy as np

#plot 1:
x = np.array([0, 1, 2, 3])
y = np.array([3, 8, 1, 10])

plt.subplot(1, 2, 1)
plt.plot(x,y)

#plot 2:
x = np.array([0, 1, 2, 3])
y = np.array([10, 20, 30, 40])

plt.subplot(1, 2, 2)
plt.plot(x,y)

plt.show()

Sonuç:


subplots() Fonksiyonu

İşlev subplots(), şeklin düzenini tanımlayan üç argüman alır.

Düzen, birinci ve ikinci argüman tarafından temsil edilen satırlar ve sütunlar halinde düzenlenir .

Üçüncü argüman, mevcut arsa indeksini temsil eder.

plt.subplot(1, 2, 1)
#the figure has 1 row, 2 columns, and this plot is the first plot.

plt.subplot(1, 2, 2)
#the figure has 1 row, 2 columns, and this plot is the second plot.

Yani, 2 satır ve 1 sütunlu bir şekil istiyorsak (yani iki grafiğin yan yana yerine üst üste görüntüleneceği anlamına gelir), sözdizimini şöyle yazabiliriz:

Örnek

Üst üste 2 arsa çizin:

import matplotlib.pyplot as plt
import numpy as np

#plot 1:
x = np.array([0, 1, 2, 3])
y = np.array([3, 8, 1, 10])

plt.subplot(2, 1, 1)
plt.plot(x,y)

#plot 2:
x = np.array([0, 1, 2, 3])
y = np.array([10, 20, 30, 40])

plt.subplot(2, 1, 2)
plt.plot(x,y)

plt.show()

Sonuç:

Tek bir şekil üzerine istediğiniz kadar grafik çizebilirsiniz, sadece satır, sütun ve grafiğin indeksini tanımlayın.

Örnek

6 arsa çizin:

import matplotlib.pyplot as plt
import numpy as np

x = np.array([0, 1, 2, 3])
y = np.array([3, 8, 1, 10])

plt.subplot(2, 3, 1)
plt.plot(x,y)

x = np.array([0, 1, 2, 3])
y = np.array([10, 20, 30, 40])

plt.subplot(2, 3, 2)
plt.plot(x,y)

x = np.array([0, 1, 2, 3])
y = np.array([3, 8, 1, 10])

plt.subplot(2, 3, 3)
plt.plot(x,y)

x = np.array([0, 1, 2, 3])
y = np.array([10, 20, 30, 40])

plt.subplot(2, 3, 4)
plt.plot(x,y)

x = np.array([0, 1, 2, 3])
y = np.array([3, 8, 1, 10])

plt.subplot(2, 3, 5)
plt.plot(x,y)

x = np.array([0, 1, 2, 3])
y = np.array([10, 20, 30, 40])

plt.subplot(2, 3, 6)
plt.plot(x,y)

plt.show()

Sonuç:



Başlık

Şu fonksiyonla her arsaya bir başlık ekleyebilirsiniz title():

Örnek

2 arsa, başlıkları ile:

import matplotlib.pyplot as plt
import numpy as np

#plot 1:
x = np.array([0, 1, 2, 3])
y = np.array([3, 8, 1, 10])

plt.subplot(1, 2, 1)
plt.plot(x,y)
plt.title("SALES")

#plot 2:
x = np.array([0, 1, 2, 3])
y = np.array([10, 20, 30, 40])

plt.subplot(1, 2, 2)
plt.plot(x,y)
plt.title("INCOME")

plt.show()

Sonuç:


süper başlık

Şu fonksiyonla tüm şekle bir başlık ekleyebilirsiniz suptitle():

Örnek

Tüm şekil için bir başlık ekleyin:

import matplotlib.pyplot as plt
import numpy as np

#plot 1:
x = np.array([0, 1, 2, 3])
y = np.array([3, 8, 1, 10])

plt.subplot(1, 2, 1)
plt.plot(x,y)
plt.title("SALES")

#plot 2:
x = np.array([0, 1, 2, 3])
y = np.array([10, 20, 30, 40])

plt.subplot(1, 2, 2)
plt.plot(x,y)
plt.title("INCOME")

plt.suptitle("MY SHOP")
plt.show()

Sonuç: