code for plot1