def autolabel(rects, ax):
    """Attach a text label above each bar in *rects*, displaying its height"""
    for rect in rects:
        height = rect.get_height()
        ax.annotate('{}'.format(height), xy=(rect.get_x() + rect.get_width(
            ) / 2, height), xytext=(0, 3), textcoords='offset points', ha=
            'center', va='bottom', color='blue')
