Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
G
geoarray
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Daniel Scheffler
  • geoarray
  • Issues
  • #17

Closed
Open
Opened Sep 11, 2018 by Daniel Scheffler@danschefMaintainer

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.
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: danschef/geoarray#17