R script to produce plot 3