File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ def autoset_widget_bins(self, data: npt.NDArray[Any]) -> None:
148
148
149
149
self .bins_start = bins [0 ]
150
150
self .bins_stop = bins [- 1 ]
151
- self .bins_num = bins .size
151
+ self .bins_num = bins .size - 1
152
152
153
153
for widget in self ._bin_widgets .values ():
154
154
widget .blockSignals (False )
@@ -208,11 +208,13 @@ def draw(self) -> None:
208
208
# whole cube into memory.
209
209
if data .dtype .kind in {"i" , "u" }:
210
210
# Make sure integer data types have integer sized bins
211
- step = abs (self .bins_stop - self .bins_start ) // (self .bins_num - 1 )
211
+ step = abs (self .bins_stop - self .bins_start ) // (self .bins_num )
212
212
step = max (1 , step )
213
213
bins = np .arange (self .bins_start , self .bins_stop + step , step )
214
214
else :
215
- bins = np .linspace (self .bins_start , self .bins_stop , self .bins_num )
215
+ bins = np .linspace (
216
+ self .bins_start , self .bins_stop , self .bins_num + 1
217
+ )
216
218
217
219
if layer .rgb :
218
220
# Histogram RGB channels independently
You can’t perform that action at this time.
0 commit comments