Code for plot four