import matplotlib.pyplot as plt
p_df = pd.DataFrame({'class': [1, 1, 2, 2, 1], 'a': [2, 3, 2, 3, 2]})
fig, ax = plt.subplots(figsize=(8, 6))
bp = p_df.groupby('class').plot(kind='kde', ax=ax)
Plotting grouped data in same plot using Pandas