Simplify code for plot1