I have a dataframe df which looks as follows:
A B
X 5 7
Y 10 5
df.to_dict() gives the following:
{'A': {'X': 5, 'Y': 10}, 'B': {'X': 7, 'Y': 5}}
I have created a stacked bar plot using
df.plot(kind = "bar", stacked = True)
I want to shade the region between A in X and Y bar, and the same for B. The shaded region reflect how the value of A and B has changed between X and Y. It should look something as shown:

How can I fill areas in between these two stacked bar plots using matplotlib in Python keeping the original structure of bar plot intact?


