Matplotlib 是
Python 中
最基礎、最廣泛使用的數據可視化庫。
特點:
- 提供低階接口,允許對圖表的每個元素進行精確控制。
- 靈活性高,可繪製各種靜態、動態、互動式圖表。
- 是許多其他 Python 可視化庫(如 Seaborn, Pandas plotting)的基礎。
- 常用模組:pyplot (提供類似 MATLAB 的接口,常用 import matplotlib.pyplot as plt)。
常用函數:`plt.plot()` (折線圖), `plt.scatter()` (散佈圖), `plt.bar()` (長條圖), `plt.hist()` (直方圖), `plt.xlabel()`, `plt.ylabel()`, `plt.title()`, `plt.legend()`, `plt.show()`。