R code for plot 2