Clustered Stacked Bar in Python Pandas
<p>I have created a single stacked bar chart but I want to have them clustered. Exactly something like the picture. </p>

<p>Wondering if it's possible. </p>

<p><a href="https://i.stack.imgur.com/SoxmW.png" rel="nofollow">link to picture</a></p>

<pre><code>df = pd.DataFrame(dict(Subsidy=[3, 3, 3],
                       Bonus=[1, 1, 1],
                       Expense=[2, 2, 2]),
                  list('ABC'))

df
</code></pre>

<p><a href="https://i.stack.imgur.com/OrFdi.png" rel="nofollow"><img src="https://i.stack.imgur.com/OrFdi.png" alt="enter image description here"></a></p>

<pre><code>ax = df[['Subsidy', 'Bonus']].plot.bar(stacked=True, position=1,
                            width=.2, ylim=[0, 8], color=['orange', 'red'])
df[['Expense']].plot.bar(ax=ax, position=0, width=.2, color=['green'])
</code></pre>

<p><a href="https://i.stack.imgur.com/TR51i.png" rel="nofollow"><img src="https://i.stack.imgur.com/TR51i.png" alt="enter image description here"></a></p>

python pandas matplotlib