Currently this code:
count_df = (df[['rank', 'name', 'variable', 'value']]
.groupby(['rank', 'variable', 'name'])
.agg('count')
.unstack())
count_df .head()
count_df.plot(kind='bar')
gets me this plot:

using subplots=Truein a call .plot(), gets me:

which is pretty useless because the colors are mapped to the same variable as the facet facet. Is there a way to choose which column / index is used for the subheading, so that I can still have colors for the column heading name( count_df), but the subheading is behind variable, so that each subheading has a bar on name/rank, grouped by rankand colored name?
source
share