implemented plot4 and generated plot.