diff --git a/pyqtgraph/graphicsItems/ImageItem.py b/pyqtgraph/graphicsItems/ImageItem.py index 50cef315..479f4917 100644 --- a/pyqtgraph/graphicsItems/ImageItem.py +++ b/pyqtgraph/graphicsItems/ImageItem.py @@ -491,7 +491,9 @@ class ImageItem(GraphicsObject): if stepData.dtype.kind in "ui": # For integer data, we select the bins carefully to avoid aliasing step = np.ceil((mx-mn) / 500.) - bins = np.arange(mn, mx+1.01*step, step, dtype=np.int) + bins = [] + if step > 0.0: + bins = np.arange(mn, mx+1.01*step, step, dtype=np.int) else: # for float data, let numpy select the bins. bins = np.linspace(mn, mx, 500)