参考:在pycharm中使用matplotlib时多张图显示问题
from matplotlib import pyplot as plt
import numpy as np
x1 = np.linspace(1, 10, 20)
y1 = x1 * x1 + 2
fig = plt.figure() #新建一个图像窗口
axes = fig.add_axes([0.1, 0.1, 0.9, 0.9])
axes.plot(x1, y1, 'r')
x1 = np.linspace(1, 10, 20)
y1 = x1 + 2
fig = plt.figure() #新建一个图像窗口
axes = fig.add_axes([0.1, 0.1, 0.9, 0.9])
axes.plot(x1, y1, 'r')
plt.show() #在最后放一个plt.show