我认为您无需
hue在这种情况下指定参数:
In [136]: ax = sns.barplot(data=dfGroupedAgg, ...: x='day_index', ...: y='avg_duration', ...: palette=sns.color_palette("Reds_d", n_colors=7, desat=1)) ...:您可以将旅行次数添加为注释:
def autolabel(rects, labels=None, height_factor=1.05): for i, rect in enumerate(rects): height = rect.get_height() if labels is not None: try: label = labels[i] except (TypeError, KeyError): label = ' ' else: label = '%d' % int(height) ax.text(rect.get_x() + rect.get_width()/2., height_factor*height, '{}'.format(label), ha='center', va='bottom')autolabel(ax.patches, labels=df.trips, height_factor=1.02)


