added R prgram to generate plot2.png