@@ -3703,16 +3703,24 @@ def test_stem(use_line_collection):
37033703
37043704
37053705def test_stem_args ():
3706+ def _assert_equal (stem_container , expected ):
3707+ x , y = map (list , stem_container .markerline .get_data ())
3708+ assert x == expected [0 ]
3709+ assert y == expected [1 ]
3710+
37063711 fig , ax = plt .subplots ()
37073712
3708- x = list ( range ( 10 ))
3709- y = list ( range ( 10 ))
3713+ x = [ 1 , 3 , 5 ]
3714+ y = [ 9 , 8 , 7 ]
37103715
37113716 # Test the call signatures
3712- ax .stem (y )
3713- ax .stem (x , y )
3714- ax .stem (x , y , linefmt = 'r--' )
3715- ax .stem (x , y , linefmt = 'r--' , basefmt = 'b--' )
3717+ _assert_equal (ax .stem (y ), expected = ([0 , 1 , 2 ], y ))
3718+ _assert_equal (ax .stem (x , y ), expected = (x , y ))
3719+ _assert_equal (ax .stem (x , y , linefmt = 'r--' ), expected = (x , y ))
3720+ _assert_equal (ax .stem (x , y , 'r--' ), expected = (x , y ))
3721+ _assert_equal (ax .stem (x , y , linefmt = 'r--' , basefmt = 'b--' ), expected = (x , y ))
3722+ _assert_equal (ax .stem (y , linefmt = 'r--' ), expected = ([0 , 1 , 2 ], y ))
3723+ _assert_equal (ax .stem (y , 'r--' ), expected = ([0 , 1 , 2 ], y ))
37163724
37173725
37183726def test_stem_dates ():
0 commit comments