R script and png file for plot 2