Merge pull request #767 from jimofthecorn/develop

fixed bug in graphicsItems/ImageItem.py: degenerate images (max==min)
This commit is contained in:
Ogi Moore 2019-05-23 23:33:27 -07:00 committed by GitHub
commit c71083fff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -487,6 +487,9 @@ class ImageItem(GraphicsObject):
if bins == 'auto':
mn = np.nanmin(stepData)
mx = np.nanmax(stepData)
if mx == mn:
# degenerate image, arange will fail
mx += 1
if np.isnan(mn) or np.isnan(mx):
# the data are all-nan
return None, None