I am trying to plot a stacked bar plot using seaborn/matplotlib with hatching. But the hatching is not proper. Its coming as shown in image
My code is as below:
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()
What am i doing wrong?