FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

I broke imshow(<signed integer array>) :-( · Issue #6825 · matplotlib/matplotlib · GitHub

Repository navigation

I broke imshow(<signed integer array>) :-( #6825

Description

mpl2.0b3

In [4]: plt.imshow(np.random.randint(-128, 128, dtype=np.int8, size=(3, 3)))
Out[4]: <matplotlib.image.AxesImage at 0x7fe00ba2f0f0>

In [5]: /usr/lib/python3.5/site-packages/matplotlib/colors.py:848: RuntimeWarning: overflow encos
  resdat /= (vmax - vmin)

and a fully black image appears.

Pretty sure this is due to #6700 and can be fixed by restoring the casts of vmin and vmax to a floating type. However that type should be determined as in process_value (i.e., np.float32 if dtype.itemsize <= 2 else np.promote_types(dtype, float) -- see the issue for the discussion).

Not making a PR yet because this (as well as the original #6700) may or may not affect the other Normalize classes too? Perhaps that's something that should be factored out.

Activity

  1. added this to the milestone on Jul 24, 2016
  2. efiring commented on Jul 25, 2016

    Member

    @anntzer, it looks like a more general solution to these problems is needed, starting with input normalization: float128 should be converted to float64 as early as possible, float32 should be preserved and used when possible, etc. Maybe the thing to do is revert #6700, and develop a more comprehensive solution, which need not block 2.0. Does this make sense to you? And if so, can you lead it?

  3. anntzer commented on Jul 25, 2016

    ContributorAuthor

    Sure, I'll give it a try. Continuing the discussion in that thread.

  4. added a commit that references this issue on Aug 1, 2016
    7e938fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL