Skip to content

Commit

Permalink
This commit fixes the deprecation error for resize_event (#157).
Browse files Browse the repository at this point in the history
`resize_event` has been deprecated since matplotlib 3.6. This commmit
transitions from `resize_event` to `ResizeEvent` as recommended.

Ref: https://qiskit.org/ecosystem/metal/_modules/matplotlib/backend_bases.html
  • Loading branch information
monodera committed Feb 7, 2024
1 parent 2ed0f26 commit 26ece83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyraf/MplCanvasAdapter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import matplotlib
matplotlib.use('TkAgg') # set backend
import matplotlib.backends.backend_tkagg as tkagg
from matplotlib.backend_bases import ResizeEvent
from .Ptkplot import hideTkCursor
from .Ptkplot import FullWindowCursor
import tkinter
Expand Down Expand Up @@ -90,7 +91,7 @@ def resize_widget(self, event):
self._tkcanvas.create_image(int(width / 2),
int(height / 2),
image=self._tkphoto)
self.resize_event()
self.callbacks.process('resize_event', ResizeEvent('resize_event', self))

def flush(self):

Expand Down

0 comments on commit 26ece83

Please sign in to comment.