Presentasi berjudul: "Plotting dengan Python"— Transcript presentasi: 1 Plotting dengan Python
2 Matplotlib Library Matplotlib boleh jadi adalah standar de facto untuk visualisasi 2 dimensi di Python. Ada beberapa cara penggunaannya:
Pendekatan mirip MATLAB: dengan modul pyplot. Pendekatan object-oriented: dengan axes.Axes dan figure.Figure. 3 Program pyplot pertama
4 Program pyplot pertama cara ke-2 5 Plot garis (x, y) import matplotlib.pyplot as plt x = [1, 2, 4, 5, 10] y = [-1, 9, 3, 4, 8] fig, ax = plt.subplots() ax.plot(x, y, 'ro-')# garis dan bulatan ax.set(ylabel = 'sumbu y', xlabel ='sumbu x') plt.show()
6 Hasil plot garis (x,y) 7 Komponen-komponen figure
8 Plot garis (x, y) lanjut import matplotlib.pyplot as plt x = [1, 2, 4, 5, 10] y = [-1, 9, 3, 4, 8] fig, ax = plt.subplots() ax.plot(x, y, 'ro-')# garis dan bulatan ax.set(ylabel = 'sumbu y', xlabel ='sumbu x’) plt.show()
9 Plot garis (x,y) lebih lanjut 10 Hasil plot garis (x,y) lanjut
11 Numpy dan Matplotlib Secara prinsip, menyerupai cara plot di MATLAB 12 Hasil plot
13 Membuat dua plot bersebelahan 14 Membuat dua plot bersebelahan ( versi
2)
15 Hasil dua plot bersebelahan 16 Visualisasi data dengan Pandas 17 Hasil
plot dengan Pandas 18 Mengatur plot Pandas dengan Matplotlib
19 Hasil mengatur plot Pandas dengan Matplotlib 20 Pilihan “kind” pada
pandas.DataFrame.plot
21 Tugas Cari file CSV apapun yang dapat digunakan sebagai file input |