Skip to content

Commit

Permalink
Fix pixel picking for multiple displays in same figure
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Jun 20, 2023
1 parent 623ac86 commit 638de74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ctapipe/visualization/mpl_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,9 @@ def clear_overlays(self):

def _on_pick(self, event):
"""handler for when a pixel is clicked"""
if event.artist is not self.pixels:
return

pix_id = event.ind[-1]
x = self.geom.pix_x[pix_id].to_value(self.unit)
y = self.geom.pix_y[pix_id].to_value(self.unit)
Expand Down
2 changes: 2 additions & 0 deletions docs/changes/2358.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix that the pixel picker of the matplotlib ``CameraDisplay`` triggers
also for clicks on other ``CameraDisplay`` instances in the same figure.

0 comments on commit 638de74

Please sign in to comment.