Closed
Description
napari_matplotlib.histogram._get_bins
returns fewer bins if the data passed to it are float
compared to if they are int
.
To reproduce:
import numpy as np
from napari_matplotlib.histogram import _get_bins
data = np.arange(0, 101, dtype=int)
print(_get_bins(data).size)
print(_get_bins(data.astype(float)).size)
which prints:
101
100
To fix, perhaps 100 bins (101 bin edges) should be created with np.linspace
for float data
Metadata
Metadata
Assignees
Labels
No labels