Bahasa

Referensi Cepat Matplotlib

Cheat sheet siap cetak untuk Referensi Cepat Matplotlib, disusun untuk pencarian cepat, belajar, dan referensi di meja

Sumber
Matplotlib Documentation (matplotlib.org)
Lisensi
MIT
Diperbarui
2026-03-27

Contoh

Isi cheat sheet ini

  • Plot Dasar
  • Subplot
  • Label & Judul
  • Kustomisasi
  • Batang & Histogram
  • Sebar & Garis
  • Axes & Tanda Sumbu
  • Legenda
  • Menyimpan
  • Pola Umum

Line Plot

import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [2, 4, 1, 8, 3]
plt.plot(x, y)
plt.show()

Pintasan Plot Cepat

plt.plot(y)              # x auto 0..N-1
plt.plot(x, y, "ro--")  # red circles, dashed
plt.plot(x, y, "bs-")   # blue squares, solid

Kode Format String

`r` `g` `b` `k`Merah, hijau, biru, hitam
`o` `s` `^` `D`Marker lingkaran, kotak, segitiga, berlian
`-` `--` `-.` `:`Garis solid, putus-putus, titik-putus, titik-titik

Unduh cheat sheet lengkap dengan semua bagian, siap cetak

Unduh PDF

Unduhan

Pilih varian yang sesuai dengan cara Anda membaca