def METHOD_NAME(gray_img, bins, lower_bound, upper_bound, mask=None):
    """Prepare the ready to plot histogram data.
    Inputs:
    gray_img       = grayscale image to analyze
    bins           = divide the data into n evenly spaced bins
    lower_bound    = the lower bound of the bins (x-axis min value)
    upper_bound    = the upper bound of the bins (x-axis max value)
    mask           = binary mask, calculate histogram from masked area only (default=None)
    Returns:
    bin_labels     = an array of histogram bin labels
    hist_percent   = an array of histogram represented by percent values
    hist_gray_data = an array of histogram (original values)
    :param gray_img: numpy.ndarray
    :param bins: int
    :param lower_bound: int
    :param upper_bound: int
    :param mask: numpy.ndarray
    :return bin_labels: numpy.ndarray
    :return hist_percent: numpy.ndarray
    :return hist_gray_data: numpy.ndarray
    """
    params.device += 1
    # Create a dummy mask if none was supplied
    if mask is None:
        mask = np.ones(gray_img.shape, dtype=np.uint8)
    # Apply mask
    pixels = len(np.where(mask > 0)[0])
    masked = gray_img[np.where(mask > 0)]
    # Store histogram data
    hist_gray_data, hist_bins = np.histogram(masked, bins, (lower_bound, upper_bound))
    # make hist percentage for plotting
    hist_percent = (hist_gray_data / float(pixels)) * 100
    # use middle value of every bin as bin label
    bin_labels = np.array([np.average([hist_bins[i], hist_bins[i+1]]) for i in range(0, len(hist_bins) - 1)])
    return bin_labels, hist_percent, hist_gray_data
    # hist_data = pd.DataFrame({'pixel intensity': bin_labels, 'proportion of pixels (%)': hist_percent})
    # return hist_data