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 9d0420b

Browse filesBrowse files
committed
FIX: re-order connection logic on setting axes
1 parent dead056 commit 9d0420b
Copy full SHA for 9d0420b

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎lib/matplotlib/widgets.py

Copy file name to clipboardExpand all lines: lib/matplotlib/widgets.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2573,10 +2573,13 @@ def __init__(self, ax, onselect, direction, *, minspan=0, useblit=False,
25732573

25742574
def new_axes(self, ax, *, _props=None, _init=False):
25752575
"""Set SpanSelector to operate on a new Axes."""
2576-
self.ax = ax
2576+
reconnect = False
25772577
if _init or self.canvas is not ax.figure.canvas:
25782578
if self.canvas is not None:
25792579
self.disconnect_events()
2580+
reconnect = True
2581+
self.ax = ax
2582+
if reconnect:
25802583
self.connect_default_events()
25812584

25822585
# Reset

0 commit comments

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