Skip to content

Commit

Permalink
mpl deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
taiwithers committed Sep 18, 2023
1 parent 473e83a commit e7bf6b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pyspeckit/spectrum/fitters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,11 +1438,13 @@ def _clearlegend(self):
axis = self.Spectrum.plotter.axis
if axis and axis.legend_ == self.fitleg:
axis.legend_ = None
if axis and self.fitleg is not None:

# commented out since ArtistList object has no attribute 'remove' - mpl deprecation
# if axis and self.fitleg is not None:
# don't remove fitleg unless it's in the current axis
# self.fitleg.set_visible(False)
if self.fitleg in axis.artists:
axis.artists.remove(self.fitleg)
# if self.fitleg in axis.artists:
# axis.artists.remove(self.fitleg)
if self.Spectrum.plotter.autorefresh:
self.Spectrum.plotter.refresh()

Expand Down

0 comments on commit e7bf6b2

Please sign in to comment.