@@ -40,7 +40,7 @@ def test_legend_auto1():
40
40
x = np .arange (100 )
41
41
ax .plot (x , 50 - x , 'o' , label = 'y=1' )
42
42
ax .plot (x , x - 50 , 'o' , label = 'y=-1' )
43
- ax .legend (loc = 'best' )
43
+ ax .legend ()
44
44
45
45
46
46
@image_comparison (baseline_images = ['legend_auto2' ], remove_text = True )
@@ -51,7 +51,7 @@ def test_legend_auto2():
51
51
x = np .arange (100 )
52
52
b1 = ax .bar (x , x , align = 'edge' , color = 'm' )
53
53
b2 = ax .bar (x , x [::- 1 ], align = 'edge' , color = 'g' )
54
- ax .legend ([b1 [0 ], b2 [0 ]], ['up' , 'down' ], loc = 'best' )
54
+ ax .legend ([b1 [0 ], b2 [0 ]], ['up' , 'down' ])
55
55
56
56
57
57
@image_comparison (baseline_images = ['legend_auto3' ])
@@ -64,7 +64,7 @@ def test_legend_auto3():
64
64
ax .plot (x , y , 'o-' , label = 'line' )
65
65
ax .set_xlim (0.0 , 1.0 )
66
66
ax .set_ylim (0.0 , 1.0 )
67
- ax .legend (loc = 'best' )
67
+ ax .legend ()
68
68
69
69
70
70
@image_comparison (baseline_images = ['legend_various_labels' ], remove_text = True )
@@ -75,7 +75,7 @@ def test_various_labels():
75
75
ax .plot (np .arange (4 ), 'o' , label = 1 )
76
76
ax .plot (np .linspace (4 , 4.1 ), 'o' , label = 'Développés' )
77
77
ax .plot (np .arange (4 , 1 , - 1 ), 'o' , label = '__nolegend__' )
78
- ax .legend (numpoints = 1 , loc = 'best' )
78
+ ax .legend (numpoints = 1 )
79
79
80
80
81
81
@image_comparison (baseline_images = ['legend_labels_first' ], extensions = ['png' ],
@@ -87,7 +87,7 @@ def test_labels_first():
87
87
ax .plot (np .arange (10 ), '-o' , label = 1 )
88
88
ax .plot (np .ones (10 )* 5 , ':x' , label = "x" )
89
89
ax .plot (np .arange (20 , 10 , - 1 ), 'd' , label = "diamond" )
90
- ax .legend (loc = 'best' , markerfirst = False )
90
+ ax .legend (markerfirst = False )
91
91
92
92
93
93
@image_comparison (baseline_images = ['legend_multiple_keys' ], extensions = ['png' ],
@@ -371,7 +371,7 @@ def test_legend_stackplot():
371
371
ax .stackplot (x , y1 , y2 , y3 , labels = ['y1' , 'y2' , 'y3' ])
372
372
ax .set_xlim ((0 , 10 ))
373
373
ax .set_ylim ((0 , 70 ))
374
- ax .legend (loc = 'best' )
374
+ ax .legend ()
375
375
376
376
377
377
def test_cross_figure_patch_legend ():
@@ -424,7 +424,7 @@ def test_not_covering_scatter():
424
424
for n in range (3 ):
425
425
plt .scatter ([n ], [n ], color = colors [n ])
426
426
427
- plt .legend (['foo' , 'foo' , 'foo' ], loc = 'best' )
427
+ plt .legend (['foo' , 'foo' , 'foo' ])
428
428
plt .gca ().set_xlim (- 0.5 , 2.2 )
429
429
plt .gca ().set_ylim (- 0.5 , 2.2 )
430
430
@@ -439,7 +439,7 @@ def test_not_covering_scatter_transform():
439
439
440
440
plt .scatter ([20 ], [10 ], transform = offset + plt .gca ().transData )
441
441
442
- plt .legend (['foo' , 'bar' ], loc = 'best' )
442
+ plt .legend (['foo' , 'bar' ])
443
443
444
444
445
445
def test_linecollection_scaled_dashes ():
0 commit comments