matplotlib-haskell icon indicating copy to clipboard operation
matplotlib-haskell copied to clipboard

Off-by-one error in line1

Open genrtul opened this issue 3 years ago • 0 comments

line1 quoted in full below:

-- | Plot a line between 0 and the length of the array with the given y values
line1 :: (Foldable t, ToJSON (t a)) => t a -> Matplotlib
line1 y = line [0..length y] y

should be [0...length y - 1], otherwise the lengths are mismatched and python throws an exception.

genrtul avatar Jan 15 '22 12:01 genrtul