grayscale
Display image as grayscale using matplotlib
The following code will load an image from a file image.png and will display it as grayscale. If you want to display the inverse grayscale, switch the cmap to cmap=’gray_r’.
The following code will load an image from a file image.png and will display it as grayscale. If you want to display the inverse grayscale, switch the cmap to cmap=’gray_r’.