'Overlay heatmap on 1D data like ECG signal

I have an ECG signal with shape (1, 5000), like this

enter image description here

and a contribution map with shape (1, 5000), which has values ranging between 0,1.

I want to plot this contribution map as a heatmap on the ECG signal. Currently, I use plt.pcolormesh(contribution) and plot like this

enter image description here

But how can I overlay a heatmap more beautifully like this plot?

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source