【发布时间】:2016-05-24 06:12:29
【问题描述】:
我有以下代码来显示堆叠条
handles = df.toPandas().set_index('x').T.plot(kind='bar', stacked=True, figsize=(11,11))
plt.legend(loc='best', title="Line", fontsize = 'small', framealpha=0)
plt.ylabel("'" + lineName + "'")
plt.show()
我想颠倒使用handles=handles[::-1]的图例顺序,但出现错误。
【问题讨论】:
-
请包括发生的错误,以及有关此数据框的一些详细信息。
-
如何反转数据框,看这里stackoverflow.com/questions/20444087/…
标签: python pandas matplotlib