matplotlib画图相关

一. plt显示一副图像

1. import matplotlib.pyplot as plt

2. plt.figure()                    # 图像名称

3. plt.imshow(picture)      # "picture"为你想要显示的图像

4. plt.show()                    # 即可显示图像

 

二. plt显示多副图像

1. import matplotlib.pyplot as plt

2. plt.figure()

3. plt.subplot(1,2,1)

4. plt.imshow(images1)

5. plt.subplot(1,2,2)

6. plt.imshow(images2)

7. plt.show()

 

原文地址:https://www.cnblogs.com/elitphil/p/11633757.html