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

Skip to content

Commit 3fca6c1

Browse files
committed
Fix attribute error bug in notify_axes_change.
1 parent ba4043a commit 3fca6c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_gtk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ def destroy(*args):
541541

542542
def notify_axes_change(fig):
543543
'this will be called whenever the current axes is changed'
544-
if self.toolbar is not None: self.toolbar.update()
544+
if getattr(self, 'toolbar', None) is not None:
545+
self.toolbar.update()
545546
self.canvas.figure.add_axobserver(notify_axes_change)
546547

547548
self.canvas.grab_focus()

0 commit comments

Comments
 (0)