问题描述:
如何批量导出python画的图形并切除白边呢?这样会很方便素材的整理,有助于提高报告制作的效率
解决方法:
out=[new1,new2,new3,new4]
plt.axis('off')
plt.gca().xaxis.set_major_locator(plt.NullLocator())
plt.gca().yaxis.set_major_locator(plt.NullLocator())
plt.subplots_adjust(top=1,bottom=0,left=0,right=1,wspace=0,hspace=0)
for i in range(4):
io.imshow(out[i]),plt.axis('off')
plt.savefig('C:/Users/Administrator/Desktop/{}.jpg'.format(i+1),dpi=300,bbox_inches='tight')