Skip to content

Feature request: groupby.hist() plot each hist in a subplot #12451

Closed
@RolandRitt

Description

@RolandRitt

I'd like to use the kwarg subplots=True when plotting histogramms of groupby
My code:

import os
import sys
import datetime
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
import numpy as np


%matplotlib notebook


dates = pd.date_range('2013-07-14 11:00:00', '2013-07-16 11:00:00', freq = 's')
cats = np.random.choice(['m', 'f', 'c'], len(dates))
data =np.random.randn(len(dates),1)

df = pd.DataFrame(data, dates)
df.columns = ['data']
df['cats']= cats

plt.figure()
ax1 = df.groupby('cats')['data'].hist(bins=20, normed=True, subplots=True) #Figure --> not working with subplots=True

Would be nice to have this feature in pandas (same would be nice to have in groupby.plot #12450 )

My pandas:

pd.__version__
'0.18.0rc1'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions