先保存图片,最后show,即:将plt.savefig()放在plt.show()之前。 plt.imshow(image.read_value()[0])plt.savefig('xxx.png')plt.show() Reference:https://stackoverflow.com/questions/9012487/matplotlib-pyplot-savefig-outputs-blank-image
Here we are going to discuss a very common problem that was faced by many newmatplotliblearners or programmers. And we will try to cover some of the solutions to overcome this issue “matplotlib savefig blank image“. Check out,What is Matplotlib and how to use it in Python Table of Conte...
1.在调用plt.show()之前调用plt.savefig('tessstttyyy.png', dpi=100)1.通过调用plt.gcf()来保存...
1.在调用plt.show()之前调用plt.savefig('tessstttyyy.png', dpi=100)1.通过调用plt.gcf()来保存...
您应该尝试在plt.savefig(outfilename+str(ID[i])+'.pdf')后面的行中添加plt.close()