matplotlib不会显示图片ubuntu

时间:2017-06-15 02:22:30

标签: matplotlib

即时通讯在ubuntu 17.04每日构建,我试图像这样使用matplotlib:

    #!/usr/bin/env python
    import PIL
    from PIL import Image
    import numpy as np
    import matplotlib as plt
    import matplotlib.pyplot as plt
    from matplotlib import *



    #plt.imshow(iar)
    #plt.show

    def threshhold(imageArray):
        blanceAr = []
        newAr = imageArray

        for eachRow in imageArray:
            for eachPix in eachRow:
                print eachPix

                i = Image.open('images/numbers.0.1.png')
                iar1 = np.asarray(i)

                i2 = Image.open('images/numbers.y0.4.png')
                iar2 = np.asarray(i)

                i3 = Image.open('images/numbers.y0.5.png')
                iar3 = np.asarray(i)

                i4 = Image.open('images/sentdex.png')
                iar4 = np.asarray(i)

                fig = plt.figure()
                ax1 = plt.subplot2grid((8,6), (0,0), rowspan=4, colspan=3)
                ax2 = plt.subplot2grid((8,6), (4,0), rowspan=4, colspan=3)
                ax3 = plt.subplot2grid((8,6), (0,3), rowspan=4, colspan=3)
                ax4 = plt.subplot2grid((8,6), (4,3), rowspan=4, colspan=3)

                ax1.imshow(iar1)
                ax2.imshow(iar2)
                ax3.imshow(iar3)
                ax4.imshow(iar4)

                plt.show()
threshhold()

我试图制作一个神经网络img扫描仪,但我遇到了麻烦! 当我运行这个时没有错误也没有弹出窗口,请帮忙!

0 个答案:

没有答案