New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Showing np.uint16 images of the form (h,w,3) is broken #2499
Comments
To be fair, the docs (http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.imshow) only claim to support float or uint8 so I would not call this broken. |
Then, maybe the real bug is that it doesn't raise an exception :) It's certainly surprising behaviour. |
luispedro
added a commit
to luispedro/matplotlib
that referenced
this issue
Oct 8, 2013
Arrays of non-uint8 types were assumed to be in 0..1 range, resulting in the small bits being showing when this was not true. Now, an explicit exception is raised. Closes issue matplotlib#2499
@luispedro Can you make a PR with that fix? |
luispedro
added a commit
to luispedro/matplotlib
that referenced
this issue
Nov 30, 2013
Arrays of non-uint8 types were assumed to be in 0..1 range, resulting in the small bits being showing when this was not true. Now, an explicit exception is raised. Closes issue matplotlib#2499
luispedro
added a commit
to luispedro/matplotlib
that referenced
this issue
Nov 30, 2013
Arrays of non-uint8 types were assumed to be in 0..1 range. When this was not true and integer values were used, only the low-order bits were used, resulting in a mangled image. Now, an explicit exception is raised. Closes issue matplotlib#2499
efiring
pushed a commit
to efiring/matplotlib
that referenced
this issue
Mar 7, 2016
Arrays of non-uint8 types were assumed to be in 0..1 range. When this was not true and integer values were used, only the low-order bits were used, resulting in a mangled image. Now, an explicit exception is raised. Closes issue matplotlib#2499
efiring
added a commit
to efiring/matplotlib
that referenced
this issue
Mar 7, 2016
tacaswell
added a commit
that referenced
this issue
Mar 7, 2016
MNT: improve image array argument checking in to_rgba. Closes #2499.
@luispedro Thanks, sorry this took so long to get resolved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a simple test case:
This results in random bits.
The problem is in file lib/matplotlib.cm.py: the conversion to
np.uint8
assumes that the input is in 0..1 format.The text was updated successfully, but these errors were encountered: