Can Matplotlib show an image?

Lan Anh

New member
Can Matplotlib show an image?
Answer
Natively, Matplotlib only supports PNG images. The commands shown below fall back on Pillow if the native read fails. The image used in this example is a PNG file, but keep that Pillow requirement in mind for your own data. The imread() function is used to read image data in an ndarray object of float32 dtype.
 

Tìm kiếm

Back
Top