I want to create barplot with seaborn that will display the mean value for three columns from pandas dataframe My dataframe is ismilar to this:
>>>name treatment weight height ind1
0 Miki 93A control 77.5 23.2 105.5
1 Lorense 75B high 35.1 25.1 57.3
2 Derek 93A high 74.3 26.4 94.5
3 Lily 24C medium 12.2 14.4 26.8
4 Tim 75B high 37.2 26.4 55.1
...
I want to get bar plot that has the treatments as x -axis, and the weight, height and ind1 as the bars. and on this to display the error.
I have tried to do it simply with seaborn, but it works to me only when I try to plot on variable, such as weight, hright or ind1, but does not let me add more than one "variable" :
ax = sns.barplot(x="treatments", y="weight", data=df)
(illustration of the results:):
I have tried to create list of variables like in matplotlib for the y :
ax = sns.barplot(x="Treat Name alias", y=["weight","height","ind1"], data=df)
but then I get the error messege:
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
the problem is that I would like to have more than one columns as the y value. I have seen the catplot option but it seems that they grouping specific columns and not plotting each column as y value with the same x-axis.
My desired output will be to have the treatment as x-axis, and then for eac treatment to have three bars, one for weight,one for height and one for the ind1. And to have the std plot (the "black line" on the bars).