import matplotlib.pyplot as plt
# 保存图片并去除白边
plt.savefig('images_path' + "image_name.png", bbox_inches = 'tight')