@@ -174,7 +174,7 @@ def test_contains():
174
174
175
175
# draw the text. This is important, as the contains method can only work
176
176
# when a renderer exists.
177
- plt .draw ()
177
+ fig . canvas .draw ()
178
178
179
179
for x , y in zip (xs .flat , ys .flat ):
180
180
mevent .x , mevent .y = plt .gca ().transAxes .transform_point ([x , y ])
@@ -238,12 +238,12 @@ def test_set_position():
238
238
# test set_position
239
239
ann = ax .annotate (
240
240
'test' , (0 , 0 ), xytext = (0 , 0 ), textcoords = 'figure pixels' )
241
- plt .draw ()
241
+ fig . canvas .draw ()
242
242
243
243
init_pos = ann .get_window_extent (fig .canvas .renderer )
244
244
shift_val = 15
245
245
ann .set_position ((shift_val , shift_val ))
246
- plt .draw ()
246
+ fig . canvas .draw ()
247
247
post_pos = ann .get_window_extent (fig .canvas .renderer )
248
248
249
249
for a , b in zip (init_pos .min , post_pos .min ):
@@ -252,12 +252,12 @@ def test_set_position():
252
252
# test xyann
253
253
ann = ax .annotate (
254
254
'test' , (0 , 0 ), xytext = (0 , 0 ), textcoords = 'figure pixels' )
255
- plt .draw ()
255
+ fig . canvas .draw ()
256
256
257
257
init_pos = ann .get_window_extent (fig .canvas .renderer )
258
258
shift_val = 15
259
259
ann .xyann = (shift_val , shift_val )
260
- plt .draw ()
260
+ fig . canvas .draw ()
261
261
post_pos = ann .get_window_extent (fig .canvas .renderer )
262
262
263
263
for a , b in zip (init_pos .min , post_pos .min ):
@@ -396,7 +396,6 @@ def test_agg_text_clip():
396
396
for x , y in np .random .rand (10 , 2 ):
397
397
ax1 .text (x , y , "foo" , clip_on = True )
398
398
ax2 .text (x , y , "foo" )
399
- plt .show ()
400
399
401
400
402
401
def test_text_size_binding ():
0 commit comments