Python 熊猫群居箱线图上的轴虫
my Pandas数据帧的头部,Python 熊猫群居箱线图上的轴虫,python,matplotlib,pandas,Python,Matplotlib,Pandas,my Pandas数据帧的头部,df,如下所示: count1 count2 totalcount season 0 3 13 16 1 1 8 32 40 1 2 5 27 32 1 3 3 10 13 1 4 0 1 1
df
,如下所示:
count1 count2 totalcount season
0 3 13 16 1
1 8 32 40 1
2 5 27 32 1
3 3 10 13 1
4 0 1 1 1
我想制作count1
、count2
和totalcount
的箱线图,按季节(有4个季节)分组,并让每组箱线图显示在单个图形中各自的子地块上
当我只使用两列时,比如说count1
和count2
,一切看起来都很棒
df.boxplot(['count1', 'count2'], by='season')
但是,当我将totalcount
添加到混合中时,轴限制就失控了
df.boxplot(['count1', 'count2', 'totalcount'], by='season')
这种情况的发生与列的顺序无关。我意识到有几种方法可以解决这个问题,但是如果这种方法能够正常工作,会方便得多
我错过什么了吗?这是熊猫身上已知的虫子吗?我在我的第一次熊猫虫子报告中找不到任何东西
我正在使用Pandas 0.14.0和matplotlib 1.3.1。您是否尝试升级Pandas/matplotlib软件包
我使用的是Pandas 0.13.1+Matplotlib 1.2.1,这是我得到的图:
In [31]: df
Out[34]:
count1 count2 totalcount season
0 3 13 16 1
1 8 32 40 1
2 5 27 32 1
3 3 10 13 1
4 0 1 1 1
5 3 13 16 2
6 8 32 40 2
7 5 27 32 3
8 3 10 13 3
9 0 1 1 4
10 3 10 13 4
11 3 13 16 4
[12 rows x 4 columns]
有趣-我实际上使用的是Pandas 0.14.0和matplotlib 1.3.1。@Greg,真的。我升级到了你的版本,问题就在那里。