Add code and plot for plot4.
Add code for plot3.R. This was missing in a previous commit.