how to save plot as image in python code example
Example 1: save matplotlib figure
plt.savefig('image.png')
Example 2: save plot in python
plt.savefig('books_read.png')
Example 3: how to write a script to display an image in python
>>> from PIL import Image
>>> img = Image.open('test.png')
>>> img.show()
Example 4: write in all corners of plot in python
from pylab import figure, text, scatter, show
text(0.1, 0.9,'matplotlib',
horizontalalignment='center',
verticalalignment='center',
transform = ax.transAxes)