Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5bd1d76

Browse files
fix for non-toolmanager use of Wx backends; set frame icon for subplot tool
1 parent 30f8b77 commit 5bd1d76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ def __init__(self, canvas, num, frame):
12841284
self.frame = frame
12851285
self.window = frame
12861286

1287-
self.toolmanager = frame.toolmanager
1287+
self.toolmanager = getattr(frame, "toolmanager", None)
12881288
self.toolbar = frame.GetToolBar()
12891289

12901290
def show(self):
@@ -1552,6 +1552,7 @@ def pan(self, *args):
15521552
def configure_subplots(self, evt):
15531553
global FigureManager # placates pyflakes: created by @_Backend.export
15541554
frame = wx.Frame(None, -1, "Configure subplots")
1555+
_set_frame_icon(frame)
15551556

15561557
toolfig = Figure((6, 3))
15571558
canvas = self.get_canvas(frame, toolfig)
@@ -1811,7 +1812,6 @@ def trigger(self, *args):
18111812
def configure_subplots(self):
18121813
frame = wx.Frame(None, -1, "Configure subplots")
18131814
_set_frame_icon(frame)
1814-
frame.toolmanager = None
18151815

18161816
toolfig = Figure((6, 3))
18171817
canvas = self.get_canvas(frame, toolfig)

0 commit comments

Comments
 (0)