R code for generating plot1.png plot