Restoring plot4.R with Project 1 version