How to add a subplot to a group of plots

后端 未结 1 1957
遇见更好的自我
遇见更好的自我 2021-01-28 17:17

I have a group of plots that I want to display as subplots. I can add most of them but I\'m struggling to add a particular one. For the code below I ca

1条回答
  •  臣服心动
    2021-01-28 18:11

    You are almost there. Simply the bracket of the last part of your code is misplaced.

    Try:

    df.assign(A=df.A.astype(int)).pivot_table(index="C", columns="B", values="A",aggfunc='count').rename_axis(None).rename_axis(None,1).plot(kind='bar', ax=ax2)
    

    0 讨论(0)
提交回复
热议问题