Skip to content

Add support in matplotlib.pyplot.imshow for float16 #15432

Closed
@geometrikal

Description

@geometrikal

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

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