Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@anntzer

Description

@anntzer
Issue body actions

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.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.