def autolabel2(rects, ax, time_max):
    """Attach a text label above each bar in *rects*, displaying its height.
	Get height from time_max so text is above error bar"""
    for rect_index in range(len(rects)):
        rect = rects[rect_index]
        height = time_max[rect_index]
        sigdig = 1 if height > 10 else 2
        ax.annotate('{}'.format(round(height, sigdig)), xy=(rect.get_x() + 
            rect.get_width() / 2, height), xytext=(0, 3), textcoords=
            'offset points', ha='center', va='bottom')
