Отображение данных из pd.DataFrame:
- легенда = имена столбцов
- x_tics = index
Вы можете преобразовать counts
Series в DataFrameи транспонировать.
fig, ax = plt.subplots()
df = pd.DataFrame({'mod': ['a','b','c','a','a','c']})
counts = df.groupby('mod', as_index=False)
counts_df = counts.size().to_frame().T
counts_df.plot(kind='bar', width=1.0, ax=ax)
# without plt.legend()
См. здесь и здесь .