9

I have numpy array with the following properties.

np.shape(I)
(300, 300)

np.min(I)
115

np.max(I)
250

Unfortunately, when I plot it, I get something greenish bluish.

How to get normal grayscale palette?

enter image description here

Dims
  • 47,675
  • 117
  • 331
  • 600
  • 1
    See also https://stackoverflow.com/questions/36532390/how-to-avoid-automatic-pseudo-coloring-in-matplotlib-pyplot-imshow and https://stackoverflow.com/questions/3823752/display-image-as-grayscale-using-matplotlib . – Warren Weckesser Jun 27 '18 at 13:57

1 Answers1

10

Try this one:

imgplot = plt.imshow(I, cmap='gray')
Bogdan Osyka
  • 1,943
  • 3
  • 14
  • 16