@@ -52,14 +52,16 @@ def test_get_labels():
5252@check_figures_equal ()
5353def test_label_loc_vertical (fig_test , fig_ref ):
5454 ax = fig_test .subplots ()
55- sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ])
55+ sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ], label = 'scatter' )
56+ ax .legend ()
5657 ax .set_ylabel ('Y Label' , loc = 'top' )
5758 ax .set_xlabel ('X Label' , loc = 'right' )
5859 cbar = fig_test .colorbar (sc )
5960 cbar .set_label ("Z Label" , loc = 'top' )
6061
6162 ax = fig_ref .subplots ()
62- sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ])
63+ sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ], label = 'scatter' )
64+ ax .legend ()
6365 ax .set_ylabel ('Y Label' , y = 1 , ha = 'right' )
6466 ax .set_xlabel ('X Label' , x = 1 , ha = 'right' )
6567 cbar = fig_ref .colorbar (sc )
@@ -69,14 +71,16 @@ def test_label_loc_vertical(fig_test, fig_ref):
6971@check_figures_equal ()
7072def test_label_loc_horizontal (fig_test , fig_ref ):
7173 ax = fig_test .subplots ()
72- sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ])
74+ sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ], label = 'scatter' )
75+ ax .legend ()
7376 ax .set_ylabel ('Y Label' , loc = 'bottom' )
7477 ax .set_xlabel ('X Label' , loc = 'left' )
7578 cbar = fig_test .colorbar (sc , orientation = 'horizontal' )
7679 cbar .set_label ("Z Label" , loc = 'left' )
7780
7881 ax = fig_ref .subplots ()
79- sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ])
82+ sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ], label = 'scatter' )
83+ ax .legend ()
8084 ax .set_ylabel ('Y Label' , y = 0 , ha = 'left' )
8185 ax .set_xlabel ('X Label' , x = 0 , ha = 'left' )
8286 cbar = fig_ref .colorbar (sc , orientation = 'horizontal' )
@@ -88,14 +92,16 @@ def test_label_loc_rc(fig_test, fig_ref):
8892 with matplotlib .rc_context ({"xaxis.labellocation" : "right" ,
8993 "yaxis.labellocation" : "top" }):
9094 ax = fig_test .subplots ()
91- sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ])
95+ sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ], label = 'scatter' )
96+ ax .legend ()
9297 ax .set_ylabel ('Y Label' )
9398 ax .set_xlabel ('X Label' )
9499 cbar = fig_test .colorbar (sc , orientation = 'horizontal' )
95100 cbar .set_label ("Z Label" )
96101
97102 ax = fig_ref .subplots ()
98- sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ])
103+ sc = ax .scatter ([1 , 2 ], [1 , 2 ], c = [1 , 2 ], label = 'scatter' )
104+ ax .legend ()
99105 ax .set_ylabel ('Y Label' , y = 1 , ha = 'right' )
100106 ax .set_xlabel ('X Label' , x = 1 , ha = 'right' )
101107 cbar = fig_ref .colorbar (sc , orientation = 'horizontal' )
0 commit comments