improved plot4.R