Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix centering when dropping zeros (#23)
When data was being plotted using a scale that included zeros (e.g., raw5_0, raw7_0, agree5_0) and those zeros were being dropped with drop_zeros=True, the resulting plot was centered to the right of the middle value, rather than in the middle of it. (See screenshot in issue.) The cause of this was that the code dropped the zero counts from the DataFrame before plotting it, resulting in a dataset that had only 5 (or 7) scale values. But the original scale was being passed in to the plotting function--- and it had one extra value (the zero). That scale was even-sized, so the code assumed that there was no middle value, and the cut-off should be between the two middle scale values. This commit fixes this issue by removing the no-longer-present "0" value from the scale before passing it to the plotting function (but only if drop_zeros has been invoked).
- Loading branch information