a sample for histogram plotting for RGB images and grayscale images