-
Notifications
You must be signed in to change notification settings - Fork 0
02.plot
wwj-2017-1117 edited this page Nov 24, 2019
·
1 revision
import matplotlib.pyplot as plt
plt.figure(1) # 第一张图 plt.subplot(211) # 第一张图中的第一张子图
plt.plot([1, 2, 3]) # 在这张子图上画画,是绘图函数。 plt.subplot(212) # 第一张图中的第二张子图
plt.plot([4, 5, 6])
plt.figure(2) # 第二张图 plt.plot([4, 1], [2, 5]) plt.title("Figure-2")
plt.figure(1) # 再切换到figure 1,子图subplot(212)仍旧是当前图 plt.subplot(211) # 令子图subplot(211)成为figure1的当前图 plt.title('Figure-1') # 添加subplot 211 的标题
plt.show()