code and png for plot4