andrewRowlinson / mplsoccer

Football pitch plotting library for matplotlib
MIT License
391 stars 80 forks source link

Fix/bin statistic #63

Closed andrewRowlinson closed 2 years ago

andrewRowlinson commented 2 years ago

Version 1.1.4

Fixed the Pitch.bin_statistic method so that it returns consistent binnumber results for the different pitch types. Now the binnumber indexing starts in the top-left hand corner as index 0, 0. Previously it depended on whether the pitch had an inverted y-axes whether the indexing started at the top or bottom left corner. This change is consistent with how indexing on a numpy array works (0, 0) is the top-left corner so this enables the bin statistics to be reconstructed from the binnumber via numpy indexing.