How to create bar gradients with different colors?

I’ve managed to achieve this using matplotlib, I need some help figuring out how to add gradient to the bars. I want the bars to start at alpha=0 and linearly increase to alpha=1 with the same colors.

I found this resource after searching but couldn’t figure out how to apply it for my use-case.

Please recommend some resources to learn these advanced concepts of matplotlib.

Thank you!

What about the linked example doesn’t work?