I would like to draw a rectangle over a matplotlib figure, in a way that allows overlaying the axes.
The answers I found online only allow drawing a rectange inside the axes, but not overlaying them. EDIT: This answer allows drawing outside the plot frame. However it does not overlay the axis. Namely, the axis is kept visible. See the example where the axis is still visible behind the red rectangle
See an example below for what I wish to achieve (Code for the bar plot can be taken from here. For the example, the figure was edited with a simple paint software).