Reputation: 2510
is it possible to create a stacked barchart facetgrid with seaborn?
g = sns.FacetGrid(data, col="city", col_order=cities, col_wrap=3, height=5)
g = g.map(plt.plot, x="date", y="value", hue='time_bin', stacked=True, marker=".")
unfortunately does not work.
Upvotes: 4
Views: 2153
Reputation: 150725
From what I can guess from your code, it can be done with plt
:
fig, axes = plt.subplots(5,3,figsize=(12,20))
axes = axes.flatten()
for city,ax in zip(cities,axes):
df = data[data.city==city].groupby(['date','time_bin']).value.count()
df.unstack().plot.bar(ax=ax, stacked=True)
Output:
Upvotes: 3