import numpy as np
import matplotlib.pyplot as plt
from skimage import img_as_uint
from skimage.io import imshow, imread
from skimage.color import rgb2hsv
from skimage.color import rgb2gray
array_1 = np.array([[255,0],[0,255]])
imshow(array_1, cmap = 'gray');
output:
C:UsersUserAppDataLocalProgramsPythonPython312Libsite-packagesskimageio_pluginsmatplotlib_plugin.py:158: UserWarning: Low image data range; displaying image with stretched contrast.
lo, hi, cmap = _get_display_range(image)
<matplotlib.image.AxesImage object at 0x0000018800153230>
i was trying to get a 2*2 matrix with white, black/black, white
but the code is showing low data range
John S is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.