Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb6e422

Browse filesBrowse files
authored
Merge pull request #8697 from anntzer/deprecate-dynamic_update
Deprecate NavigationToolbar2.dynamic_update.
2 parents da711e1 + 7f0e27c commit eb6e422
Copy full SHA for eb6e422

File tree

Expand file treeCollapse file tree

9 files changed

+9
-27
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+9
-27
lines changed
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
NavigationToolbar2.dynamic_update is deprecated
2+
```````````````````````````````````````````````
3+
4+
Use `FigureCanvas.draw_idle` instead.

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,9 +2711,6 @@ class NavigationToolbar2(object):
27112711
whenever a mouse button is released, you'll be notified with
27122712
the event
27132713
2714-
:meth:`dynamic_update` (optional)
2715-
dynamically update the window while navigating
2716-
27172714
:meth:`set_message` (optional)
27182715
display message
27192716
@@ -2778,8 +2775,9 @@ def back(self, *args):
27782775
self.set_history_buttons()
27792776
self._update_view()
27802777

2778+
@cbook.deprecated("2.1", alternative="canvas.draw_idle")
27812779
def dynamic_update(self):
2782-
pass
2780+
self.canvas.draw_idle()
27832781

27842782
def draw_rubberband(self, event, x0, y0, x1, y1):
27852783
"""Draw a rectangle rubberband to indicate zoom limits."""
@@ -3024,7 +3022,7 @@ def drag_pan(self, event):
30243022
#safer to use the recorded button at the press than current button:
30253023
#multiple button can get pressed during motion...
30263024
a.drag_pan(self._button_pressed, event.key, event.x, event.y)
3027-
self.dynamic_update()
3025+
self.canvas.draw_idle()
30283026

30293027
def drag_zoom(self, event):
30303028
"""Callback for dragging in zoom mode."""

‎lib/matplotlib/backends/backend_gtk.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_gtk.py
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,6 @@ def release(self, event):
681681
try: del self._pixmapBack
682682
except AttributeError: pass
683683

684-
def dynamic_update(self):
685-
# legacy method; new method is canvas.draw_idle
686-
self.canvas.draw_idle()
687-
688684
def draw_rubberband(self, event, x0, y0, x1, y1):
689685
'adapted from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/189744'
690686
drawable = self.canvas.window

‎lib/matplotlib/backends/backend_gtk3.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_gtk3.py
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,6 @@ def release(self, event):
544544
try: del self._pixmapBack
545545
except AttributeError: pass
546546

547-
def dynamic_update(self):
548-
# legacy method; new method is canvas.draw_idle
549-
self.canvas.draw_idle()
550-
551547
def draw_rubberband(self, event, x0, y0, x1, y1):
552548
'adapted from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/189744'
553549
self.ctx = self.canvas.get_property("window").cairo_create()

‎lib/matplotlib/backends/backend_macosx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_macosx.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ def prepare_configure_subplots(self):
241241
def set_message(self, message):
242242
_macosx.NavigationToolbar2.set_message(self, message.encode('utf-8'))
243243

244-
def dynamic_update(self):
245-
self.canvas.draw_idle()
246244

247245
########################################################################
248246
#

‎lib/matplotlib/backends/backend_qt5.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,6 @@ def zoom(self, *args):
706706
super(NavigationToolbar2QT, self).zoom(*args)
707707
self._update_buttons_checked()
708708

709-
def dynamic_update(self):
710-
self.canvas.draw_idle()
711-
712709
def set_message(self, s):
713710
self.message.emit(s)
714711
if self.coordinates:

‎lib/matplotlib/backends/backend_tkagg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_tkagg.py
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -859,11 +859,6 @@ def update(self):
859859
# self.omenu.adjust(naxes)
860860
NavigationToolbar2.update(self)
861861

862-
def dynamic_update(self):
863-
'update drawing area only if idle'
864-
# legacy method; new method is canvas.draw_idle
865-
self.canvas.draw_idle()
866-
867862

868863
class ToolTip(object):
869864
"""

‎lib/matplotlib/backends/backend_webagg_core.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_webagg_core.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,6 @@ def set_cursor(self, cursor):
423423
self.canvas.send_event("cursor", cursor=cursor)
424424
self.cursor = cursor
425425

426-
def dynamic_update(self):
427-
self.canvas.draw_idle()
428-
429426
def draw_rubberband(self, event, x0, y0, x1, y1):
430427
self.canvas.send_event(
431428
"rubberband", x0=x0, y0=y0, x1=x1, y1=y1)

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from matplotlib.path import Path
4141
from matplotlib.transforms import Affine2D
4242
from matplotlib.widgets import SubplotTool
43-
from matplotlib import rcParams
43+
from matplotlib import cbook, rcParams
4444

4545
from . import wx_compat as wxc
4646
import wx
@@ -1675,6 +1675,7 @@ def release(self, event):
16751675
except AttributeError:
16761676
pass
16771677

1678+
@cbook.deprecated("2.1", alternative="canvas.draw_idle")
16781679
def dynamic_update(self):
16791680
d = self._idle
16801681
self._idle = False

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.