Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIX: re-order connection logic on setting axes
  • Loading branch information
tacaswell committed Jul 3, 2024
commit 9d0420b6a051c0f2f618d2ac319498f9d9b39fbd
5 changes: 4 additions & 1 deletion lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2573,10 +2573,13 @@ def __init__(self, ax, onselect, direction, *, minspan=0, useblit=False,

def new_axes(self, ax, *, _props=None, _init=False):
"""Set SpanSelector to operate on a new Axes."""
self.ax = ax
reconnect = False
if _init or self.canvas is not ax.figure.canvas:
Comment thread
tacaswell marked this conversation as resolved.
if self.canvas is not None:
self.disconnect_events()
reconnect = True
self.ax = ax
if reconnect:
self.connect_default_events()

# Reset
Expand Down