python35 利用matplotlib的subplot画多幅图

来源:互联网 发布:qq三国js心法 编辑:程序博客网 时间:2024/05/29 17:46

一 画直方图

import matplotlib.pyplot as pltplt.figure("hist")arr=images.flatten()n, bins, patches = plt.hist(arr, bins=256, normed=1,edgecolor='None',facecolor='red')  plt.show()

二 利用subplot画多幅图

import matplotlib.pyplot as pltplt.figure()plt.subplot(1,2,1)plt.imshow(images[i])plt.subplot(1,2,2)plt.imshow(maskes[i])plt.show()
原创粉丝点击