R script for plot1.