from matplotlib import pyplot as plt # As png plt.savefig('Path/FigureName.png') # As pdf plt.savefig('Path/FigureName.pdf')
In [5]: plt.savefig('books_read.png')
fig.write_image("images/fig1.png")