Simplified logic in plot1.R, plot2.R, plot3.R, plot4.R