Simplified plot1.R code (no change in output plot)