import matplotlib.pyplot as plt
plt.figure()
plt.subplot(2,2,1) # 将画板分为2行两列,本幅图位于第一个位置
plt.imshow(img)
plt.subplot(2,2,2) # 将画板分为2行两列,本幅图位于第二个位置
plt.imshow(img)
plt.subplot(2,2,3) # 将画板分为2行两列,本幅图位于第3个位置
plt.imshow(img)
plt.show()
结果如下图
import matplotlib.pyplot as plt
plt.figure()
plt.subplot(2,2,1) # 将画板分为2行两列,本幅图位于第一个位置
plt.imshow(img)
plt.subplot(2,2,2) # 将画板分为2行两列,本幅图位于第二个位置
plt.imshow(img)
plt.subplot(2,2,3) # 将画板分为2行两列,本幅图位于第3个位置
plt.imshow(img)
plt.show()
结果如下图