matplotlib show image as grayscale code example Example: imshow grayscale plt.imshow(im, cmap='gray')