Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

สรุปโครงสร้าง (Anatomy) ของ Matplotlib Plots ใน Python

โครงสร้างลำดับชั้น (Hierarchy)

Matplotlib สร้างบน NumPy มีโครงสร้างแบบ Tree:

  • Figure: ภาชนะระดับบนสุด (Outer container) สามารถมีหลาย Axes
  • Axes: พื้นที่พลอตจริง (Subplot) — ไม่ใช่ แกน (Axis) — มี ticks, lines, legends, text boxes
  • Axis: แกน X, Y (มี tick locators, formatters)

ทุก Object ใน Matplotlib สามารถปรับแต่งได้ทุกส่วน

สรุปโครงสร้าง (Anatomy) ของ Matplotlib Plots ใน Python

Image credit: https://matplotlib.org/examples/showcase/anatomy.html