Histogram is displaying the distribution of data. Color histogram shows distribution for each band.
Red = image(:,:,1);
Green = image(:,:,2);
Blue = image(:,:,3);
[yRed, x] = imhist(Red);
[yGreen, x] = imhist(Green);
[yBlue, x] = imhist(Blue);
plot(x, yRed, 'Red', x, yGreen, 'Green', x, yBlue, 'Blue');
Best Answer