I'm trying to create a bar plot where just one of the bars is stacked. I'm trying it out with a MultiIndex, but not sure if this would be the best approach. Here's a quick example of how the dataframe looks like:
df = pd.DataFrame({'case 1': [-12, 0, 0, 0, 7, -5],
'case 2': [0, -5, -3, -4, 9, -3]},
index=pd.MultiIndex.from_arrays([['investment', 'investment', 'investment',
'investment', 'profit', 'difference'],
list('gabc ')],
names=['one', 'two']))
case 1 case 2
one two
investment g -12 0
a 0 -5
b 0 -3
c 0 -4
profit 7 9
difference -5 -3
df.plot(kind='bar', stacked=True, rot=0)
I want just that the data on 'investments' 'a', 'b' and 'c' are combined on a stacked bar. I feel I may be close to a solution, but I'm completely stuck on this, and I'm not sure using a MultiIndex is the best way to do this.
Here's how I want it to look like:

Would someone have an idea on how to achieve this? Thanks!
