How do you save a figure in png format in python code example Example: how to save matplotlib figure to png In [5]: plt.savefig('books_read.png')