python function library and code used to create figures