R script and png file for plot 3