You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import matplotlib.pyplot as plt
import numpy as np
A = np.array([np.arange(256,dtype=np.uint16) for _ in xrange(256)])
B = (A<<8)+(255*np.random.random(A.shape)).astype(np.uint16)
B = np.dstack([B,B,B])
plt.imshow(B)
plt.show()
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.