def bar_chart_mf(data, path_name):
    """Make a bar chart for data on MF quantities."""
    N = len(data)

    ind = np.arange(N)  # the x locations for the groups
    width = 0.8       # the width of the bars

    fig, ax = pyplot.subplots()
    rects1 = ax.bar(ind, data, width, color='g')

    # add some text for labels, title and axes ticks
    ax.set_ylabel('Population')
    ax.set_xticks(ind+width/2)
    labs = ['m='+str(i) for i in range(-N/2+1, N/2+1)]
    ax.set_xticklabels(labs)

    def autolabel(rects):
        # attach some text labels
        for rect in rects:
            rect.get_height()

    autolabel(rects1)
    pyplot.savefig(path_name)
    pyplot.close()
def bar_chart_mf ( data , path_name ) : N = len ( data ) ind = np . arange ( N ) width = 0.8 fig , ax = pyplot . subplots ( ) rects1 = ax . bar ( ind , data , width , color = 'g' ) ax . set_ylabel ( 'Population' ) ax . set_xticks ( ind + width / 2 ) labs = [ 'm=' + str ( i ) for i in range ( - N / 2 + 1 , N / 2 + 1 ) ] ax . set_xticklabels ( labs ) def autolabel ( rects ) : for rect in rects : rect . get_height ( ) autolabel ( rects1 ) pyplot . savefig ( path_name ) pyplot . close ( )
Make a bar chart for data on MF quantities.