from skimage import data,ioimport matplotlib.pyplot as pltimg=data.coffee() plt.figure('image')io.imshow(img)plt.title('coffee')plt.show()plt.figure('hist')arr=img.flatten()plt.hist(arr, bins=256, density=1,edgecolor='None',facecolor='blue') plt.title('histogram')plt.show()import cv2from skimage import data,ioimg=data.coffee() colormap1 = imgplt.imshow(colormap1)chans=cv2.split(colormap1)colors=("b", "g", "r")plt.figure()plt.title("Color histogram")plt.xlabel("Bins")plt.ylabel("Number of pixels")for (chan, c) in zip(chans, colors): hist=cv2.calcHist([chan], [0], None, [256], [0,256]) plt.plot(hist, color=c) plt.xlim([0,256])plt.show()