« Minimal Reproducible »

Home Tags About GitHub

np.array is also ok!

Published at 2024-01-15
Last update over 365 days ago Licensed under CC BY-NC-SA 4.0 langspythonmatplotlib

https://stackoverflow.com/questions/35286540/how-to-display-an-image

import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('your_image.png')
# np.array is also ok!
imgplot = plt.imshow(img)
plt.show()

« Minimal Reproducible »

Powered by Astro