automatically save matplotlib figure code example Example: save matplotlib figure plt.savefig('image.png')