Code to create the plots shown in the blog