BUG: Bad axis limits when using DataFrame.boxplot() with odd number of columns (excluding 1) and 'by' parameter. · Issue #7528 · pandas-dev/pandas (original) (raw)

The head of my Pandas dataframe , df, is shown below:

      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

I'd like to make boxplots of count1, count2, and totalcount, grouped by season (there are 4 seasons) and have each set of box plots show up on their own subplot in a single figure.

When I do this with only two of the columns, say count1 and count2, everything looks great.

df.boxplot(['count1', 'count2'], by='season')

enter image description here

But when I add totalcount to the mix, the axis limits go haywire.

df.boxplot(['count1', 'count2', 'totalcount'], by='season')

enter image description here

This happens irregardless of the order of the columns. I realize there are several ways around this problem, but it would be much more convenient if this worked properly. I believe this worked as expected in Pandas 0.13.1.

Output from pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.7.final.0
python-bits: 64
OS: Darwin
OS-release: 13.2.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.14.0
nose: 1.3.3
Cython: 0.20.1
numpy: 1.8.1
scipy: 0.14.0
statsmodels: 0.5.0
IPython: 2.1.0
sphinx: None
patsy: 0.2.1
scikits.timeseries: None
dateutil: 2.2
pytz: 2014.4
bottleneck: None
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.3.1
openpyxl: None
xlrd: 0.9.3
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.3.2
html5lib: None
bq: None
apiclient: None
rpy2: None
sqlalchemy: 0.9.4
pymysql: None
psycopg2: 2.5.3 (dt dec pq3 ext)