我正在尝试使用seaborn/matplotlib进行阴影堆积条形图的绘制,但是阴影效果不正确,如下图所示:
我的代码如下:
sc_bar=sns.barplot(x='Salt Concentration',y='EPS
Produced',data=df_salt_conc_mod,hue='Strain',fill=False,edgecolor='black')
bars = sc_bar.patches
pattern=['//','..','xx','*']
hatches=np.tile(pattern,7)
i=0
for bar in bars:
bar.set_hatch(pattern[i])
i+=1
count+=1
if(i>3):
i=0
sc_bar.legend()
我做错了什么?