我相信你需要通过过滤前三行DataFrame.head
,然后绘制所有4列A,B,C,D
由DataFrame.plot.bar
:
df.head(3).plot.bar(stacked=True, colors=['blue','red','green', 'pink'])
或者你可能想要转置,所以:
df.head(3).T.plot.bar(stacked=True, colors=['blue','red','green'])
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句