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

Skip to content

Commit 9ab08da

Browse files
committed
minor tweak to legend picking example
svn path=/trunk/matplotlib/; revision=7351
1 parent 274f872 commit 9ab08da

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/event_handling/legend_picking.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ def onpick(event):
3131
# legend proxy line, and toggle the visibilit
3232
legline = event.artist
3333
origline = lined[legline]
34-
vis = origline.get_visible()
35-
origline.set_visible(not vis)
34+
vis = not origline.get_visible()
35+
origline.set_visible(vis)
3636
# Change the alpha on the line in the legend so we can see what lines
3737
# have been toggled
38-
if not vis:
38+
if vis:
3939
legline.set_alpha(1.0)
4040
else:
4141
legline.set_alpha(0.2)

0 commit comments

Comments
 (0)