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

Skip to content

Commit b6e4e88

Browse files
committed
Simplify access to selector artists
1 parent 0c06766 commit b6e4e88

File tree

2 files changed

+93
-95
lines changed

2 files changed

+93
-95
lines changed

lib/matplotlib/tests/test_widgets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def onselect(epress, erelease):
104104
do_event(tool, 'onmove', xdata=100, ydata=120, button=1)
105105
do_event(tool, 'release', xdata=100, ydata=120, button=1)
106106

107-
artist = tool.artists[0]
107+
artist = tool._selection_artist
108108
assert artist.get_facecolor() == mcolors.to_rgba('b', alpha=0.2)
109109
props = dict(facecolor='r', alpha=0.3)
110110
tool.set_props(**props)
@@ -448,7 +448,7 @@ def onselect(epress, erelease):
448448
do_event(tool, 'onmove', xdata=100, ydata=120, button=1)
449449
do_event(tool, 'release', xdata=100, ydata=120, button=1)
450450

451-
artist = tool.artists[0]
451+
artist = tool._selection_artist
452452
assert artist.get_facecolor() == mcolors.to_rgba('b', alpha=0.2)
453453
props = dict(facecolor='r', alpha=0.3)
454454
tool.set_props(**props)
@@ -862,7 +862,7 @@ def onselect(vertices):
862862
for (etype, event_args) in event_sequence:
863863
do_event(tool, etype, **event_args)
864864

865-
artist = tool.artists[0]
865+
artist = tool._selection_artist
866866
assert artist.get_color() == 'b'
867867
assert artist.get_alpha() == 0.2
868868
props = dict(color='r', alpha=0.3)

0 commit comments

Comments
 (0)