save figure python matplotlib code example Example 1: save matplotlib figure plt.savefig('image.png') Example 2: save plot in python plt.savefig('books_read.png')