0

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

enter image description here

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). enter image description here

Yuval Atzmon
  • 5,645
  • 3
  • 41
  • 74

1 Answers1

-1

It is drawn via matplotlib.pyplot.hist() function in matplotlib