has2k1 / mizani

A scales package for python
https://mizani.readthedocs.io
BSD 3-Clause "New" or "Revised" License
49 stars 14 forks source link

bounds.rescale_max yields NaN when maximum of data is 0 #16

Closed bersbersbers closed 4 years ago

bersbersbers commented 4 years ago

I just tried to use plotnine to plot data which has values [-5, -4, -3, -2, -1, 0], and received a lot of warnings and an improper plot, in line with this (mis?)behavior:

>>> mizani.bounds.rescale_max([-5, -4, -3, -2, -1, 0])
array([-inf, -inf, -inf, -inf, -inf,  nan])