modify the function dev.copy() to png() so that the lengend in plot3 and plot4 will adjust automaticly