Python function library and codes used to create figures