@@ -538,24 +538,25 @@ def test_shadow_argument_types():
538
538
ax .plot ([1 , 2 , 3 ], label = 'test' )
539
539
shadows = [True , False , 'red' , (0.1 , 0.2 , 0.5 ), 'tab:cyan' , False ]
540
540
541
- legends = (ax .legend (loc = 'upper left' , shadow = True ), # True
542
- ax .legend (loc = 'upper right' , shadow = False ), # False
543
- ax .legend (loc = 'center left' , shadow = 'red' ), # Color string
544
- ax .legend (loc = 'center right' , shadow = (0.1 , 0.2 , 0.5 )), # Color tuple
545
- ax .legend (loc = 'lower left' , shadow = 'tab:cyan' ) # Color tab
546
- )
547
- for l in legends :
541
+ legs = (ax .legend (loc = 'upper left' , shadow = True ), # True
542
+ ax .legend (loc = 'upper right' , shadow = False ), # False
543
+ ax .legend (loc = 'center left' , shadow = 'red' ), # string
544
+ ax .legend (loc = 'center right' , shadow = (0.1 , 0.2 , 0.5 )), # tuple
545
+ ax .legend (loc = 'lower left' , shadow = 'tab:cyan' ) # tab
546
+ )
547
+ for l in legs :
548
548
ax .add_artist (l )
549
549
ax .legend (loc = 'lower right' ) # default
550
550
551
- legends = [c for c in ax .get_children () if isinstance (c , mpl .legend .Legend )]
552
- assert len (legends ) == len (shadows )
553
- for i in range (len (legends )):
554
- assert legends [i ].shadow == shadows [i ]
551
+ legs = [c for c in ax .get_children () if isinstance (c , mpl .legend .Legend )]
552
+ assert len (legs ) == len (shadows )
553
+ for i in range (len (legs )):
554
+ assert legs [i ].shadow == shadows [i ]
555
555
556
556
with pytest .raises (ValueError , match = "color or bool" ):
557
557
ax .legend (loc = "upper left" , shadow = "aardvark" ) # Bad argument
558
558
559
+
559
560
def test_shadow_framealpha ():
560
561
# Test if framealpha is activated when shadow is True
561
562
# and framealpha is not explicitly passed'''
0 commit comments