Reputation: 83
I have the following dataframe:
import pandas as pd
data = {'country': ['US', 'DE', 'IT', 'US', 'DE', 'IT', 'US', 'DE', 'IT'],
'year': [2000,2000,2000,2001,2001,2001,2002,2002,2002],
'share': [0.5, 0.3, 0.2, 0.6,0.1,0.3,0.4,0.2,0.4]}
data = pd.DataFrame(data)
I want to display the data with a stacked bar chart.
X-axis: year, Y-axis: share, Color: country
All the three bars for 2000, 2001 and 2002 should have the same height (for each year, the total of the share == 1)
Upvotes: 0
Views: 57