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