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:
148148
149149 self .bins_start = bins [0 ]
150150 self .bins_stop = bins [- 1 ]
151- self .bins_num = bins .size
151+ self .bins_num = bins .size - 1
152152
153153 for widget in self ._bin_widgets .values ():
154154 widget .blockSignals (False )
@@ -208,11 +208,13 @@ def draw(self) -> None:
208208 # whole cube into memory.
209209 if data .dtype .kind in {"i" , "u" }:
210210 # 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 )
212212 step = max (1 , step )
213213 bins = np .arange (self .bins_start , self .bins_stop + step , step )
214214 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+ )
216218
217219 if layer .rgb :
218220 # Histogram RGB channels independently
You can’t perform that action at this time.
0 commit comments