earthlab / matplotcheck

A python package for checking and testing matplotlib plots. We use this for autograding student assignments but there are many other potential use cases including package testing (for packages with plots)!
https://matplotcheck.readthedocs.io
BSD 3-Clause "New" or "Revised" License
18 stars 8 forks source link

Add a sort values parameter to assert_xy #380

Open nkorinek opened 3 years ago

nkorinek commented 3 years ago

Sometimes, in xy plots, there's no consistent way to test that the lines are exactly the same. For example, if a student is plotting two lines, the xy plot data grabbed from the plot will change based on which line they plot first. For plots like this, although it's not ideal, it's more consistent to sort the xy values grabbed from the plot and grade against the sorted values. This way we check that all of the values from all lines are in the plot consistently.