code and png for plot2