insert r code for plot1