show_histogram(): ValueError: range parameter must be finite.
ValueError in case GeoArray.show_histogram() is called with a 2D GeoArray.
GeoArray(2darray).show_histogram()
ValueError Traceback (most recent call last)
<ipython-input-167-a2f7922a6194> in <module>()
1 from spechomo_eval.fig_homogenized_images import _calc_sam
2 sam = _calc_sam(s2_homo[:100, :100, :], s2_train[:100, :100, :], axis=2)
----> 3 GeoArray(sam).show_histogram()
~/scheffler/python/geoarray/geoarray/baseclasses.py in show_histogram(self, band, bins, normed, exclude_nodata, vmin, vmax, figsize)
1344
1345 plt.figure(figsize=figsize)
-> 1346 plt.hist(list(image2plot.flat), density=normed, bins=bins, color='gray', range=[vmin, vmax])
1347 plt.xlabel('Pixel value')
1348 plt.ylabel('Probabilty' if normed else 'Count')
~/python_GFZ/python/lib/python3.6/site-packages/matplotlib/pyplot.py in hist(x, bins, range, density, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, stacked, normed, hold, data, **kwargs)
3130 histtype=histtype, align=align, orientation=orientation,
3131 rwidth=rwidth, log=log, color=color, label=label,
-> 3132 stacked=stacked, normed=normed, data=data, **kwargs)
3133 finally:
3134 ax._hold = washold
~/python_GFZ/python/lib/python3.6/site-packages/matplotlib/__init__.py in inner(ax, *args, **kwargs)
1853 "the Matplotlib list!)" % (label_namer, func.__name__),
1854 RuntimeWarning, stacklevel=2)
-> 1855 return func(ax, *args, **kwargs)
1856
1857 inner.__doc__ = _add_data_doc(inner.__doc__,
~/python_GFZ/python/lib/python3.6/site-packages/matplotlib/axes/_axes.py in hist(***failed resolving arguments***)
6528 # this will automatically overwrite bins,
6529 # so that each histogram uses the same bins
-> 6530 m, bins = np.histogram(x[i], bins, weights=w[i], **hist_kwargs)
6531 m = m.astype(float) # causes problems later if it's an int
6532 if mlast is None:
~/python_GFZ/python/lib/python3.6/site-packages/numpy/lib/function_base.py in histogram(a, bins, range, normed, weights, density)
667 if not np.all(np.isfinite([mn, mx])):
668 raise ValueError(
--> 669 'range parameter must be finite.')
670 if mn == mx:
671 mn -= 0.5
ValueError: range parameter must be finite.