【发布时间】:2021-08-01 16:06:06
【问题描述】:
我有一个在 python 中使用 seaborn 生成的条形图,如下所示:
x 轴将始终包含颜色。有没有一种简单的方法可以让条形的颜色与 x 轴上的颜色相匹配?
到目前为止我的代码:
plt.figure(figsize=(12,8))
slippers_plot = sns.barplot(data=slipper_colour,x='colour', y='total_units', palette='bright')
slippers_plot
slippers_plot.set_title("Top Slipper Colors", fontsize=20, pad=30, fontdict={"weight": "bold"})
slippers_plot.set_xlabel("Total Units", fontsize=16)
slippers_plot.set_ylabel("", fontsize=18)
plt.xticks(fontsize=14)
plt.yticks(fontsize=14)
【问题讨论】:
标签: python colors seaborn bar-chart axis-labels