Seaborn workaround for hue barplot

前端 未结 4 2023
时光取名叫无心
时光取名叫无心 2021-01-04 23:17

I have the following DataFrame on a Jupyter notebook which plots using seaborn a barplot:

data = {\'day_index\': [0, 1, 2, 3, 4, 5, 6],
              


        
4条回答
  •  温柔的废话
    2021-01-04 23:43

    Here is the solution

    ax = sns.barplot(data=df, \
                     x='day_index', \
                     y='avg_duration', \
                     hue='trips', \
                     dodge=False, \
                     palette=sns.color_palette("Reds_d", n_colors=7, desat=1))
    

提交回复
热议问题