一 、概述
1.1 相關(guān)庫的版本
本篇文章主要是用于索引與Matplotlib可視化的文章。其中:
matplotlib.__version__ == 3.3.3
numpy.__verison__ == 1.18.5
1.2 繪圖風(fēng)格
而Matplotlib前身實際上是Matlab中的繪圖工具,為此,Matplotlib提供了兩種繪制風(fēng)格:pyplot 風(fēng)格 以及OO(Object-Oriented,面向?qū)ο? 風(fēng)格
import matplotlib.pyplot as plt
# style 1: pyplot style
plt.bar(x, y)
plt.show()
# style 2: OO style
fig, ax = plt.subplots()
ax.bar(x, y)
fig.show()
在我寫的這些文章中,我將主要使用面向?qū)ο箫L(fēng)格。