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
  • 42,427
  • 94
  • 291
  • 543
  • 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

9

Try this one:

imgplot = plt.imshow(I, cmap='gray')
Bogdan Osyka
  • 1,793
  • 3
  • 11
  • 15