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

Skip to content

Commit 4d1a2de

Browse files
authored
Merge pull request #13711 from anntzer/tktoolbaractive
Deprecate NavigationToolbar2Tk.set_active.
2 parents 6a6527c + f85e051 commit 4d1a2de

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Deprecations
2+
````````````
3+
``NavigationToolbar2Tk.set_active`` is deprecated, as it has no (observable)
4+
effect.

examples/user_interfaces/embedding_in_wx3_sgskip.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
This is yet another example of using matplotlib with wx. Hopefully
1313
this is pretty full-featured:
1414
15-
- both matplotlib toolbar and WX buttons manipulate plot
16-
- full wxApp framework, including widget interaction
17-
- XRC (XML wxWidgets resource) file to create GUI (made with XRCed)
15+
- both matplotlib toolbar and WX buttons manipulate plot
16+
- full wxApp framework, including widget interaction
17+
- XRC (XML wxWidgets resource) file to create GUI (made with XRCed)
1818
1919
This was derived from embedding_in_wx and dynamic_image_wxagg.
2020
@@ -46,7 +46,6 @@ def __init__(self, parent):
4646
self.canvas = FigureCanvas(self, -1, self.fig)
4747
self.toolbar = NavigationToolbar(self.canvas) # matplotlib toolbar
4848
self.toolbar.Realize()
49-
# self.toolbar.set_active([0,1])
5049

5150
# Now put all into a sizer
5251
sizer = wx.BoxSizer(wx.VERTICAL)

lib/matplotlib/backends/_backend_tk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ def save_figure(self, *args):
637637
except Exception as e:
638638
tkinter.messagebox.showerror("Error saving file", str(e))
639639

640+
@cbook.deprecated("3.1")
640641
def set_active(self, ind):
641642
self._ind = ind
642643
self._active = [self._axes[i] for i in self._ind]

0 commit comments

Comments
 (0)