Title: matplotlib plot multilevel dataframe
Tags: pandas;plot;multi-level
Question: [enter image description here][1]i have the following dataframe:
year    event   Gender  population
2013    10k       F          1995
2013    10k       M          3783
2013    21k       F          526
2013    21k       M          2194
2013    42k       F          130
2013    42k       M          710
2014    10k       F          2735
2014    10k       M          4729
2014    21k       F          885
2014    21k       M          3085
2014    42k       F          216
2014    42k       M          1274
i would like to create a multilevel stack plot that will look like this:
like this:
Comment: Possible duplicate of [pandas - multi index plotting](https://stackoverflow.com/questions/31845258/pandas-multi-index-plotting)

Comment: `df.set_index(['year','event','Gender'])['population'].unstack().plot(kind='bar',stacked=True)



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2018:00:07/24/18', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<pandas><plot><multi-level>', 'Title': 'matplotlib plot multilevel dataframe', 'ViewCount': 271, 'id': 51502736, 'user_AboutMe': '', 'user_AccountId': 2653295.0, 'user_DisplayName': 'igor_mintz', 'user_Reputation': 13.0, 'user_Views': 8.0, 'user_id': 9699534.0}}