Plotting function for figure 1