7月
30
matplotlib教程:多图
import numpy as np
import matplotlib.pyplot as plt
# 多图指的是创建多个figure对象
# 子图指的是在一个figure对象上画多个子图
fig1 = plt.figure()
ax1 = fig1.add_subplot(111)
ax1.plot([1, 2, 3], [3, 2, 1])
fig2 = plt.figure()
ax2 = fig2.add_subplot(111)
ax2.plot([1, 2, 3], [1, 2, 3])
plt.show()