def draw_histogram_bar(histogram, lim, main ='', xlab = '', linecol='cyan', bgcol='black', cex=1):
    """Draw a histogram bar
    
    Parameters:
    1. histogram: a dictionary of histogram. This dictionary must have 'bin' and 'count', which must be the same length
    2. lim: lower and upper boundary for drowing histogram
    3. linecol: line color. Default = cyan
    4. bgcol: background color. Default = black
    """

    top=1
    bot=0
    mid=2.0/sum(lim)
    if cex == 1:
        rscript=R.plot(lim,[bot,top], xlim=lim, ylim=[bot,top], tp="n", frame=False, yaxt="n", xlab=xlab, ylab="",main=main)
    else:
        rscript=R.plot(lim,[bot,top], xlim=lim, ylim=[bot,top], tp="n", frame=False, yaxt="n", xlab=xlab, ylab="",main=main, cex=cex)
    rscript+=R.polygon([lim[0],lim[1],lim[1],lim[0]],[bot,bot,top,top], col = [bgcol])
    
    # draw a histogram
    N = 0.8                         # ratio for normalization
    max_count=max(histogram['count'])    # get the maximum count and normalize the other counts with it
    probability = [N * h / max_count for h in histogram['count']]    # normalize
    within_lim = arglim(histogram['bin'],lim)  # get the index of elements within lim
    bins2draw = array_extractor(histogram['bin'], within_lim)    # extract the corresponding bins
    prob2draw = array_extractor(probability, within_lim)    # extract the corresponding probabilities
    rscript += R.lines(bins2draw, prob2draw, col=[linecol], xlim=lim, ylim=[bot, top], lwd =2)  # draw using R.lines
    
    return rscript
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/draw_histogram_bar/swapped operands of `/`