code to construct plot1