def barGraphCreation(A_sizes, B_sizes, cluster_sizes, types, total_size, colors, graph_size):
    mydpi = 100.
    fig = plt.figure(figsize = (graph_size[0]/mydpi, (graph_size[1])/mydpi), dpi = mydpi)
    fig.set_facecolor('white')
    ax = fig.add_subplot(111)
    number_of_bars = min(10,len(A_sizes))
    A_values = numpy.array(A_sizes[0:number_of_bars])*100. /  total_size
    B_values = numpy.array(B_sizes[0:number_of_bars])* 100. / total_size

    # Add pure clusters
    for i in range(number_of_bars):
        if types[i]=='A':
            A_values[i] = cluster_sizes[i]*100./total_size
        if types[i]=='B':
            B_values[i] = cluster_sizes[i]*100./total_size

    x = numpy.array(range(len(A_values)))
    ax.bar(left = x,width = 1.0, height = A_values, color = colors['A'])
    ax.bar(left = x, width = 1.0, bottom = A_values, height = B_values, color = colors['B'])
    ax.set_ylabel('%')

    pylab.yticks(fontsize=8)
    pylab.xticks(fontsize=7)
    fig.text(0.75,0.8,"Acc: %0.2f"%(numpy.sum(cluster_sizes)*100/total_size),size= 7)

    return fig2img(fig)
Draws a bar graph with information about the number of elements in the first ten biggest clusters.
dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/pyproct/tools/plotTools.py/barGraphCreation