correct iteration in plot

I'm correcting an obvious mistake. You can see that the interior of the loop needs to access `y_i` and `y_i+1` so that's why the 1 is subtracted from the length of the array.