@@ -90,8 +90,9 @@ def onselect(epress, erelease):
90
90
91
91
if kwargs .get ('drawtype' , None ) not in ['line' , 'none' ]:
92
92
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 )
95
96
96
97
assert ax ._got_onselect
97
98
@@ -118,40 +119,41 @@ def onselect(epress, erelease):
118
119
119
120
# drag the rectangle
120
121
do_event (tool , 'press' , xdata = 10 , ydata = 10 , button = 1 ,
121
- key = ' ' )
122
+ key = ' ' )
123
+
122
124
do_event (tool , 'onmove' , xdata = 30 , ydata = 30 , button = 1 )
123
125
do_event (tool , 'release' , xdata = 30 , ydata = 30 , button = 1 )
124
126
assert tool .extents == (120 , 170 , 120 , 170 )
125
127
126
128
# create from center
127
129
do_event (tool , 'on_key_press' , xdata = 100 , ydata = 100 , button = 1 ,
128
- key = 'control' )
130
+ key = 'control' )
129
131
do_event (tool , 'press' , xdata = 100 , ydata = 100 , button = 1 )
130
132
do_event (tool , 'onmove' , xdata = 125 , ydata = 125 , button = 1 )
131
133
do_event (tool , 'release' , xdata = 125 , ydata = 125 , button = 1 )
132
134
do_event (tool , 'on_key_release' , xdata = 100 , ydata = 100 , button = 1 ,
133
- key = 'control' )
135
+ key = 'control' )
134
136
assert tool .extents == (75 , 125 , 75 , 125 )
135
137
136
138
# create a square
137
139
do_event (tool , 'on_key_press' , xdata = 10 , ydata = 10 , button = 1 ,
138
- key = 'shift' )
140
+ key = 'shift' )
139
141
do_event (tool , 'press' , xdata = 10 , ydata = 10 , button = 1 )
140
142
do_event (tool , 'onmove' , xdata = 35 , ydata = 30 , button = 1 )
141
143
do_event (tool , 'release' , xdata = 35 , ydata = 30 , button = 1 )
142
144
do_event (tool , 'on_key_release' , xdata = 10 , ydata = 10 , button = 1 ,
143
- key = 'shift' )
145
+ key = 'shift' )
144
146
extents = [int (e ) for e in tool .extents ]
145
147
assert extents == [10 , 35 , 10 , 34 ]
146
148
147
149
# create a square from center
148
150
do_event (tool , 'on_key_press' , xdata = 100 , ydata = 100 , button = 1 ,
149
- key = 'ctrl+shift' )
151
+ key = 'ctrl+shift' )
150
152
do_event (tool , 'press' , xdata = 100 , ydata = 100 , button = 1 )
151
153
do_event (tool , 'onmove' , xdata = 125 , ydata = 130 , button = 1 )
152
154
do_event (tool , 'release' , xdata = 125 , ydata = 130 , button = 1 )
153
155
do_event (tool , 'on_key_release' , xdata = 100 , ydata = 100 , button = 1 ,
154
- key = 'ctrl+shift' )
156
+ key = 'ctrl+shift' )
155
157
extents = [int (e ) for e in tool .extents ]
156
158
assert extents == [70 , 129 , 70 , 130 ]
157
159
@@ -261,7 +263,7 @@ def test_CheckButtons():
261
263
262
264
263
265
@image_comparison (baseline_images = ['check_radio_buttons' ], extensions = ['png' ],
264
- style = 'default' )
266
+ style = 'mpl20' , remove_text = True )
265
267
def test_check_radio_buttons_image ():
266
268
get_ax ()
267
269
plt .subplots_adjust (left = 0.3 )
@@ -272,6 +274,15 @@ def test_check_radio_buttons_image():
272
274
(False , True , True ))
273
275
274
276
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
+
275
286
def test_slider_slidermin_slidermax_invalid ():
276
287
fig , ax = plt .subplots ()
277
288
# test min/max with floats
0 commit comments