Skip to content

Commit

Permalink
Fix issues in viewer with recent versions of Matplotlib
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Nov 15, 2024
1 parent 22ad813 commit 58dea3b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions astrodendro/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def _update_lines(self, selection_id):

# Remove previously selected collection
if selection_id in self.selected_lines:
self.ax_dendrogram.collections.remove(self.selected_lines[selection_id])
self.selected_lines[selection_id].remove()
del self.selected_lines[selection_id]

if structure is None:
Expand Down Expand Up @@ -308,15 +308,13 @@ def _update_lines(self, selection_id):
self.ax_dendrogram.add_collection(self.selected_lines[selection_id])

def remove_contour(self, selection_id):

if selection_id in self.selected_contour:
for collection in self.selected_contour[selection_id].collections:
self.ax_image.collections.remove(collection)
self.selected_contour[selection_id].remove()
del self.selected_contour[selection_id]

def remove_all_contours(self):
""" Remove all selected contours. """
for key in self.selected_contour.keys():
for key in list(self.selected_contour):
self.remove_contour(key)

def update_contours(self):
Expand Down

0 comments on commit 58dea3b

Please sign in to comment.