BUG/VIS: groupby.hist/plot() should pass group keys as labels · Issue #6279 · pandas-dev/pandas (original) (raw)
At least wherever possible.
In [2]: df = pd.DataFrame(np.random.randn(30, 2), columns=['A', 'B'])
In [3]: df['C'] = 15 * ['a'] + 15 * ['b']
In [4]: ax = df.groupby('C')['A'].hist()
Ideally the group keys would be the legend for the plot.
I can take this one.