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 2842536

Browse filesBrowse files
authored
Merge pull request #14418 from meeseeksmachine/auto-backport-of-pr-14285-on-v3.1.0-doc
Backport PR #14285 on branch v3.1.0-doc (DOC: add note to example about keeping hard-ref to SpanSelector)
2 parents 1dba133 + e75738d commit 2842536
Copy full SHA for 2842536

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+9
-1
lines changed

‎examples/widgets/span_selector.py

Copy file name to clipboardExpand all lines: examples/widgets/span_selector.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ def onselect(xmin, xmax):
3838
ax2.set_ylim(thisy.min(), thisy.max())
3939
fig.canvas.draw()
4040

41-
# Set useblit=True on most backends for enhanced performance.
41+
#############################################################################
42+
# .. note
43+
#
44+
# If the SpanSelector object is garbage collected you will lose the
45+
# interactivity. You must keep a hard reference to it to prevent this.
46+
#
47+
48+
4249
span = SpanSelector(ax1, onselect, 'horizontal', useblit=True,
4350
rectprops=dict(alpha=0.5, facecolor='red'))
51+
# Set useblit=True on most backends for enhanced performance.
4452

4553

4654
plt.show()

0 commit comments

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