python codes used to create figures