python plt文件保存为png图片
作者:互联网
保存为png图片
fig = plt.gcf()
print "ImageSave Done!"
fig.savefig(outPut)
保存为base64文件
先保存为png图片,然后将其转化为base64文件
figfile = BytesIO()
fig.savefig(figfile, format='png')
figfile.seek(0) # rewind to beginning of file
figdata_png = base64.b64encode(figfile.getvalue())
标签:plt,python,base64,保存,figfile,savefig,fig,png 来源: https://blog.csdn.net/weixin_43098506/article/details/120508547