matplotlib – plt.imshow() of a single color image showing as black
Advertisements I am trying to show a light-gray image using plt.imshow(), but the image turns out black. I tried: import matplotlib.pyplot as plt import numpy as np test_image = np.zeros((3871, 2484)) test_image.fill(200) plt.imshow(test_image, cmap="gray") plt.show() But ended up getting: Matplotlib version: 3.7.1 Numpy version: 1.24.3 Python version: 3.11.3 >Solution : Solution You have to include… Read More matplotlib – plt.imshow() of a single color image showing as black