Code for plot1