@@ -104,18 +104,19 @@ 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 )
110- tool .set_props (** props )
110+ tool .selection_artist . set (** props )
111111 assert artist .get_facecolor () == mcolors .to_rgba (* props .values ())
112112
113- for artist in tool ._handles_artists :
113+ for artist in tool .handles_artists :
114114 assert artist .get_markeredgecolor () == 'black'
115115 assert artist .get_alpha () == 0.5
116116 handle_props = dict (markeredgecolor = 'r' , alpha = 0.3 )
117- tool .set_handle_props (** handle_props )
118- for artist in tool ._handles_artists :
117+ for artist in tool .handles_artists :
118+ artist .set (** handle_props )
119+ for artist in tool .handles_artists :
119120 assert artist .get_markeredgecolor () == 'r'
120121 assert artist .get_alpha () == 0.3
121122
@@ -325,18 +326,19 @@ def onselect(epress, erelease):
325326 do_event (tool , 'onmove' , xdata = 100 , ydata = 120 , button = 1 )
326327 do_event (tool , 'release' , xdata = 100 , ydata = 120 , button = 1 )
327328
328- artist = tool .artists [ 0 ]
329+ artist = tool .selection_artist
329330 assert artist .get_facecolor () == mcolors .to_rgba ('b' , alpha = 0.2 )
330331 props = dict (facecolor = 'r' , alpha = 0.3 )
331- tool .set_props (** props )
332+ tool .selection_artist . set (** props )
332333 assert artist .get_facecolor () == mcolors .to_rgba (* props .values ())
333334
334- for artist in tool ._handles_artists :
335+ for artist in tool .handles_artists :
335336 assert artist .get_color () == 'b'
336337 assert artist .get_alpha () == 0.5
337338 handle_props = dict (color = 'r' , alpha = 0.3 )
338- tool .set_handle_props (** handle_props )
339- for artist in tool ._handles_artists :
339+ for artist in tool .handles_artists :
340+ artist .set (** handle_props )
341+ for artist in tool .handles_artists :
340342 assert artist .get_color () == 'r'
341343 assert artist .get_alpha () == 0.3
342344
@@ -739,20 +741,21 @@ def onselect(vertices):
739741 for (etype , event_args ) in event_sequence :
740742 do_event (tool , etype , ** event_args )
741743
742- artist = tool .artists [ 0 ]
744+ artist = tool .selection_artist
743745 assert artist .get_color () == 'b'
744746 assert artist .get_alpha () == 0.2
745747 props = dict (color = 'r' , alpha = 0.3 )
746- tool .set_props (** props )
748+ tool .selection_artist . set (** props )
747749 assert artist .get_color () == props ['color' ]
748750 assert artist .get_alpha () == props ['alpha' ]
749751
750- for artist in tool ._handles_artists :
752+ for artist in tool .handles_artists :
751753 assert artist .get_color () == 'b'
752754 assert artist .get_alpha () == 0.5
753755 handle_props = dict (color = 'r' , alpha = 0.3 )
754- tool .set_handle_props (** handle_props )
755- for artist in tool ._handles_artists :
756+ for artist in tool .handles_artists :
757+ artist .set (** handle_props )
758+ for artist in tool .handles_artists :
756759 assert artist .get_color () == 'r'
757760 assert artist .get_alpha () == 0.3
758761
0 commit comments