Update figure_3_and_4.R

Make compatible with clean formatting of Dryad submission.