some R code for ploting