I'm trying to create a bar chart in seaborn that displays values for two variables(Weight, Variance) for each row (Factor) in my data frame. Here is what my data looks like:
Factor Weight Variance
Growth 10% 0.15
Value 20% 0.35
Here is my code:
fig=plt.figure(figsize=(10,10))
ax1=fig.add_subplot(221)
sns.barplot(x=df.index, y=df[['Weight', 'Variance']], ax=ax1)
The above throws back an error every time that I can't debug. What I am trying to achieve is have one plot, that shows two colored bars for each Factor; weight in one color (ex: red) and variance in another color (ex: blue).
Anyone have suggestions or potential workarounds?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…