script and plot for 1st figure