Examples taken of http://matplotlib.org/users/pyplot_tutorial.html