创建一个figure,4个subplot
import matplotlib.pyplot as plt
plt.figure()
plt.subplot(2, 2, 1)
plt.plot([0, 1], [0, 1])
plt.subplot(2, 2, 2)
plt.plot([0, 1], [0, 1])
plt.subplot(2, 2, 3)
plt.plot([0, 1], [0, 1])
plt.subplot(2, 2, 4)
plt.plot([0, 1], [0, 1])
plt.show()
效果图

创建1个figure,1个较大subplot,3个较小subplot
import matplotlib.pyplot as plt
plt.figure()
plt.subplot(2, 1, 1)
plt.plot([0, 1], [0, 1])
plt.subplot(2, 3, 4)
plt.plot([0, 1], [0, 1])
plt.subplot(2, 3, 5)
plt.plot([0, 1], [0, 1])
plt.subplot(2, 3, 6)
plt.plot([0, 1], [0, 1])
plt.show()
效果图
