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

Skip to content

Commit 4fbc21e

Browse files
committed
Deduplicate wx configure_subplots tool.
... by using the old toolbar implementation instead.
1 parent 95f7818 commit 4fbc21e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
``backend_wx.ConfigureSubplotsWx.configure_subplots`` and
5+
``backend_wx.ConfigureSubplotsWx.get_canvas`` are deprecated.

lib/matplotlib/backends/backend_wx.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,13 +1406,13 @@ def pan(self, *args):
14061406
self.ToggleTool(self.wx_ids['Zoom'], False)
14071407
NavigationToolbar2.pan(self, *args)
14081408

1409-
def configure_subplots(self, evt):
1409+
def configure_subplots(self, *args):
14101410
global FigureManager # placates pyflakes: created by @_Backend.export
14111411
frame = wx.Frame(None, -1, "Configure subplots")
14121412
_set_frame_icon(frame)
14131413

14141414
toolfig = Figure((6, 3))
1415-
canvas = self.get_canvas(frame, toolfig)
1415+
canvas = type(self.canvas)(frame, -1, toolfig)
14161416

14171417
# Create a figure manager to manage things
14181418
FigureManager(canvas, 1, frame)
@@ -1653,8 +1653,10 @@ def set_message(self, s):
16531653

16541654
class ConfigureSubplotsWx(backend_tools.ConfigureSubplotsBase):
16551655
def trigger(self, *args):
1656-
self.configure_subplots()
1656+
NavigationToolbar2Wx.configure_subplots(
1657+
self._make_classic_style_pseudo_toolbar())
16571658

1659+
@cbook.deprecated("3.2")
16581660
def configure_subplots(self):
16591661
frame = wx.Frame(None, -1, "Configure subplots")
16601662
_set_frame_icon(frame)
@@ -1671,6 +1673,7 @@ def configure_subplots(self):
16711673
SubplotTool(self.canvas.figure, toolfig)
16721674
frame.Show()
16731675

1676+
@cbook.deprecated("3.2")
16741677
def get_canvas(self, frame, fig):
16751678
return type(self.canvas)(frame, -1, fig)
16761679

0 commit comments

Comments
 (0)