import numpy as np import matplotlib as plt a = np.full((256, 256), 255, dtype=np.float32) plt.imshow(a, cmap='gray')
I want to plot white plot but it is plotting black. I have also tried 0 and 1 in place of 255 but still getting black plot. Can anyone let me know where I am making mistake?
cmap
you have to add two other parameters:plt.imshow(a, cmap='gray', vmin=0, vmax=255)
vmin=0, vmax=255
, but the image will be greenish in style (more artistic in my opinion).