update a code to make figures