Final plot and code