scripts and figures for plots 1-4