plot format and data analysis code