@@ -282,16 +282,19 @@ def test_df_legend_labels_secondary_y_legend_loc(self):
282
282
_check_legend_labels (ax , labels = ["a" , "b (right)" , "c" ])
283
283
ax = df2 .plot (legend = False , ax = ax )
284
284
_check_legend_labels (ax , labels = ["a" , "b (right)" , "c" ])
285
- ax = df3 .plot (kind = "bar" , legend = True , secondary_y = "h" , legend_loc = "upper right" , ax = ax )
285
+ ax = df3 .plot (
286
+ kind = "bar" , legend = True , secondary_y = "h" , legend_loc = "upper right" , ax = ax
287
+ )
286
288
_check_legend_labels (ax , labels = ["a" , "b (right)" , "c" , "g" , "h (right)" , "i" ])
287
289
288
290
@pytest .mark .parametrize (
289
- "kind, labels" ,
290
- [
291
- ("line" , ["a" , "b" ]),
292
- ("bar" , ["a" , "b" ]),
293
- ("scatter" , ["b" ]), # scatter(x="a", y="b") usually labels the y series
294
- ])
291
+ "kind, labels" ,
292
+ [
293
+ ("line" , ["a" , "b" ]),
294
+ ("bar" , ["a" , "b" ]),
295
+ ("scatter" , ["b" ]), # scatter(x="a", y="b") usually labels the y series
296
+ ],
297
+ )
295
298
def test_across_kinds_legend_loc (self , kind , labels ):
296
299
df = DataFrame ({"a" : [1 , 2 , 3 ], "b" : [3 , 2 , 1 ]})
297
300
if kind == "scatter" :
@@ -302,14 +305,11 @@ def test_across_kinds_legend_loc(self, kind, labels):
302
305
y = "b" ,
303
306
label = "b" ,
304
307
legend = True ,
305
- legend_loc = "upper right"
308
+ legend_loc = "upper right" ,
306
309
)
307
310
else :
308
311
ax = _check_plot_works (
309
- df .plot ,
310
- kind = kind ,
311
- legend = True ,
312
- legend_loc = "upper right"
313
- )
312
+ df .plot , kind = kind , legend = True , legend_loc = "upper right"
313
+ )
314
314
_check_legend_labels (ax , labels = labels )
315
- assert ax .get_legend () is not None
315
+ assert ax .get_legend () is not None
0 commit comments