Fixed up plotting script