Graphing for chapter 2

There was a more Pythonic way to do this, but I could pretty much copy and paste the code from the script for chapter 1, so I did that instead.