@@ -90,8 +90,9 @@ def onselect(epress, erelease):
9090
9191 if kwargs .get ('drawtype' , None ) not in ['line' , 'none' ]:
9292 assert_allclose (tool .geometry ,
93- [[100. , 100 , 199 , 199 , 100 ], [100 , 199 , 199 , 100 , 100 ]],
94- err_msg = tool .geometry )
93+ [[100. , 100 , 199 , 199 , 100 ],
94+ [100 , 199 , 199 , 100 , 100 ]],
95+ err_msg = tool .geometry )
9596
9697 assert ax ._got_onselect
9798
@@ -118,40 +119,41 @@ def onselect(epress, erelease):
118119
119120 # drag the rectangle
120121 do_event (tool , 'press' , xdata = 10 , ydata = 10 , button = 1 ,
121- key = ' ' )
122+ key = ' ' )
123+
122124 do_event (tool , 'onmove' , xdata = 30 , ydata = 30 , button = 1 )
123125 do_event (tool , 'release' , xdata = 30 , ydata = 30 , button = 1 )
124126 assert tool .extents == (120 , 170 , 120 , 170 )
125127
126128 # create from center
127129 do_event (tool , 'on_key_press' , xdata = 100 , ydata = 100 , button = 1 ,
128- key = 'control' )
130+ key = 'control' )
129131 do_event (tool , 'press' , xdata = 100 , ydata = 100 , button = 1 )
130132 do_event (tool , 'onmove' , xdata = 125 , ydata = 125 , button = 1 )
131133 do_event (tool , 'release' , xdata = 125 , ydata = 125 , button = 1 )
132134 do_event (tool , 'on_key_release' , xdata = 100 , ydata = 100 , button = 1 ,
133- key = 'control' )
135+ key = 'control' )
134136 assert tool .extents == (75 , 125 , 75 , 125 )
135137
136138 # create a square
137139 do_event (tool , 'on_key_press' , xdata = 10 , ydata = 10 , button = 1 ,
138- key = 'shift' )
140+ key = 'shift' )
139141 do_event (tool , 'press' , xdata = 10 , ydata = 10 , button = 1 )
140142 do_event (tool , 'onmove' , xdata = 35 , ydata = 30 , button = 1 )
141143 do_event (tool , 'release' , xdata = 35 , ydata = 30 , button = 1 )
142144 do_event (tool , 'on_key_release' , xdata = 10 , ydata = 10 , button = 1 ,
143- key = 'shift' )
145+ key = 'shift' )
144146 extents = [int (e ) for e in tool .extents ]
145147 assert extents == [10 , 35 , 10 , 34 ]
146148
147149 # create a square from center
148150 do_event (tool , 'on_key_press' , xdata = 100 , ydata = 100 , button = 1 ,
149- key = 'ctrl+shift' )
151+ key = 'ctrl+shift' )
150152 do_event (tool , 'press' , xdata = 100 , ydata = 100 , button = 1 )
151153 do_event (tool , 'onmove' , xdata = 125 , ydata = 130 , button = 1 )
152154 do_event (tool , 'release' , xdata = 125 , ydata = 130 , button = 1 )
153155 do_event (tool , 'on_key_release' , xdata = 100 , ydata = 100 , button = 1 ,
154- key = 'ctrl+shift' )
156+ key = 'ctrl+shift' )
155157 extents = [int (e ) for e in tool .extents ]
156158 assert extents == [70 , 129 , 70 , 130 ]
157159
@@ -261,7 +263,7 @@ def test_CheckButtons():
261263
262264
263265@image_comparison (baseline_images = ['check_radio_buttons' ], extensions = ['png' ],
264- style = 'default' )
266+ style = 'mpl20' , remove_text = True )
265267def test_check_radio_buttons_image ():
266268 get_ax ()
267269 plt .subplots_adjust (left = 0.3 )
@@ -272,6 +274,15 @@ def test_check_radio_buttons_image():
272274 (False , True , True ))
273275
274276
277+ @image_comparison (baseline_images = ['check_bunch_of_radio_buttons' ],
278+ style = 'mpl20' , extensions = ['png' ], remove_text = True )
279+ def test_check_bunch_of_radio_buttons ():
280+ rax = plt .axes ([0.05 , 0.1 , 0.15 , 0.7 ])
281+ widgets .RadioButtons (rax , ('B1' , 'B2' , 'B3' , 'B4' , 'B5' , 'B6' ,
282+ 'B7' , 'B8' , 'B9' , 'B10' , 'B11' , 'B12' ,
283+ 'B13' , 'B14' , 'B15' ))
284+
285+
275286def test_slider_slidermin_slidermax_invalid ():
276287 fig , ax = plt .subplots ()
277288 # test min/max with floats
0 commit comments