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

Skip to content

Commit 7df9532

Browse files
committed
Manually collect lines
1 parent 102b4a5 commit 7df9532

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/widgets/check_buttons.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
s2 = np.sin(6*np.pi*t)
99

1010
fig, ax = plt.subplots()
11-
ax.plot(t, s0, visible=False, lw=2, color='k', label='2 Hz')
12-
ax.plot(t, s1, lw=2, color='r', label='4 Hz')
13-
ax.plot(t, s2, lw=2, color='g', label='6 Hz')
11+
l0, = ax.plot(t, s0, visible=False, lw=2, color='k', label='2 Hz')
12+
l1, = ax.plot(t, s1, lw=2, color='r', label='4 Hz')
13+
l2, = ax.plot(t, s2, lw=2, color='g', label='6 Hz')
1414
plt.subplots_adjust(left=0.2)
1515

16-
lines = ax.get_lines()
16+
lines = [l0, l1, l2]
1717

1818
# Make checkbuttons with all plotted lines with correct visibility
1919
rax = plt.axes([0.05, 0.4, 0.1, 0.15])

0 commit comments

Comments
 (0)