Repository navigation
Commit fe924d6
committed
Check axes identity in image.contains.
Otherwise, image.contains(event) will incorrectly return True for a
click in *another* axes, somewhere else, that happens to be at the same
x/ydata. Try e.g.
```
from pylab import *
axs = gcf().subplots(2)
im0 = axs[0].imshow([[0, 1], [2, 3]])
im1 = axs[1].imshow([[0, 1], [2, 3]])
gcf().canvas.mpl_connect(
"button_press_event",
lambda event: print(im0.contains(event), im1.contains(event)))
show()
```1 parent 95f6280 commit fe924d6
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
628 | 635 | | |
629 | 636 | | |
630 | 637 | | |
| |||
0 commit comments