From dcbe16b297555f823960222653b4cfd905d9f714 Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Thu, 16 Nov 2023 01:55:39 -0500 Subject: [PATCH] histogram calculation fix, now n_edges always == hist --- fastplotlib/widgets/histogram_lut.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastplotlib/widgets/histogram_lut.py b/fastplotlib/widgets/histogram_lut.py index 0d8ca9f15..64feb8df6 100644 --- a/fastplotlib/widgets/histogram_lut.py +++ b/fastplotlib/widgets/histogram_lut.py @@ -180,7 +180,8 @@ def _calculate_histogram(self, data): hist_scaled = hist_flanked / (hist_flanked.max() / 100) if edges_flanked.size > hist_scaled.size: - edges_flanked = edges_flanked[:-1] + # we don't care about accuracy here so if it's off by 1-2 bins that's fine + edges_flanked = edges_flanked[:hist_scaled.size] return hist, edges, hist_scaled, edges_flanked