code to output completed Fig 1 as pdf file