14
以下代碼僅顯示主類別['one','two','three','four','five','six']作爲x軸標籤。有一種方法顯示子類別['A','B','C','D']作爲輔助x軸標籤嗎? 具有多個標籤的條形圖
df = pd.DataFrame(np.random.rand(6, 4),
index=['one', 'two', 'three', 'four', 'five', 'six'],
columns=pd.Index(['A', 'B', 'C', 'D'],
name='Genus')).round(2)
df.plot(kind='bar',figsize=(10,4))
我能想到的兩種選擇:1.下面主之一創建自組織二次X軸(見[此](http://stackoverflow.com/questions/31803817/how-to-add-second-x-axis-the-the-the-the-one-the-one-in-matplotlib)); 2.從'df.unstack()。plot.bar()'開始,然後更改圖形屬性。 – VinceP