pydata/pandas — pull request #7234 by sinhrks (2014-05-24 22:12:03+00:00)
Title: BUG: grouped hist raises AttributeError with single group

Includes 3 minor fixes for `hist`.

+ `DataFrame.hist` raises `AttributeError` when the target column specifiedwith `by` kw only contains a single value.

```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pandas.util.testing as tm

n=100
gender = tm.choice(['Male', 'Female'], size=n)
classroom = tm.choice(['A', 'B', 'C'], size=n)
single = tm.choice(['S'], size=n)

df = pd.DataFrame({'gender': gender,
'classroom': classroom,
'single': single,
'height': np.random.normal(66, 4, size=n),
'weight': np.random.normal(161, 32, size=n),
'category': np.random.randint(4, size=n)})

df.hist(by='single')
# AttributeError: 'AxesSubplot' object has no attribute 'ravel'
```

+ `hist` can accept `rot` kw only when `by` is specified, but `rot` actually does nothing. I understand `rot` value should be used for `xticklabels` rotation if `xrot` is not specified?
```
df.hist(rot=45)
# AttributeError: Unknown property rot
# -> This is OK because we can use xrot kw

df.hist(by='classroom', rot=45)
# It raises no error, but ticks are NOT rotated.
```

+ `hist` always displays `xticklabels` on all axes even if specifying `sharex=True`. Other plots only draws `xticklabels` on bottom axes if `sharex` is True.