0

This is my data, i want to make a multiple barplot for the cluster that holds the columns so the bars would be 4 (represents panicattacks ,compulsivebehavior ,depression and anxiety) and will repeat for each cluster (total is 6).

            panicattacks    compulsivebehavior   depression anxiety
cluster             
0                2.0               0.0                2.0   2.0
1                1.0               1.0                2.0   2.0
2                0.0               0.0                0.0   0.0
3                3.0               3.0                3.0   3.0
4                1.0               1.0                7.0   7.0
5                1.0               0.0                6.0   7.0
6                0.0               0.0                0.0   0.0

I want to make multiple barplot like this. I followed and modified it but it does not work it shows, How should i do it?

ax = plt.subplot(111)
for i,row in enumerate(unemployed.values):
    ax.bar(unemployed.index[i], unemployed['panicattacks'], width=0.2, color='b', align='center')
    ax.bar(unemployed.index[i], unemployed['compulsivebehavior'], width=0.2, color='r', align='center')
    ax.bar(unemployed.index[i], unemployed['depression'], width=0.2, color='g', align='center')
    ax.bar(unemployed.index[i], unemployed['anxiety'], width=0.2, color='y', align='center')

plot

random student
  • 683
  • 1
  • 15
  • 33

0 Answers0