ch4 updated with matplotlib inline and pyplot explicitly imported