Add support in matplotlib.pyplot.imshow for float16
Bug report
Bug summary
imshow of array with dtype float16 fails with unsupported dtype
Code for reproduction
import numpy as np import matplotlib.pyplot as plt #This works: a = np.asarray([[0.1,0.2],[0.3,0.4]], dtype=np.float64) plt.imshow(a), plt.show() #This fails a = np.asarray([[0.1,0.2],[0.3,0.4]], dtype=np.float16) plt.imshow(a), plt.show()
Matplotlib version
- Operating system: Windows 10 1903
- Matplotlib version: 3.1.1
- Matplotlib backend (
print(matplotlib.get_backend())): module://backend_interagg - Python version: 3.73
- Jupyter version (if applicable): n/a
- Other libraries:
installed from default conda