Plotting script now works as expected.