plot3 R script