@@ -31,6 +31,7 @@ def test_Polygon_close():
3131
3232 # start with open path and close it:
3333 p = Polygon (xy , closed = True )
34+ assert p .get_closed ()
3435 assert_array_equal (p .get_xy (), xyclosed )
3536 p .set_xy (xy )
3637 assert_array_equal (p .get_xy (), xyclosed )
@@ -43,6 +44,7 @@ def test_Polygon_close():
4344
4445 # start with open path and leave it open:
4546 p = Polygon (xy , closed = False )
47+ assert not p .get_closed ()
4648 assert_array_equal (p .get_xy (), xy )
4749 p .set_xy (xy )
4850 assert_array_equal (p .get_xy (), xy )
@@ -723,6 +725,31 @@ def test_annulus_setters():
723725 ell .angle = 45
724726
725727
728+ @image_comparison (baseline_images = ['annulus' ], extensions = ['png' ])
729+ def test_annulus_setters2 ():
730+
731+ fig , ax = plt .subplots ()
732+ cir = Annulus ((0. , 0. ), 0.2 , 0.01 , fc = 'g' ) # circular annulus
733+ ell = Annulus ((0. , 0. ), (1 , 2 ), 0.1 , 0 , # elliptical
734+ fc = 'm' , ec = 'b' , alpha = 0.5 , hatch = 'xxx' )
735+ ax .add_patch (cir )
736+ ax .add_patch (ell )
737+ ax .set_aspect ('equal' )
738+
739+ cir .center = (0.5 , 0.5 )
740+ cir .set_semimajor (0.2 )
741+ cir .set_semiminor (0.2 )
742+ assert cir .radii == (0.2 , 0.2 )
743+ cir .width = 0.05
744+
745+ ell .center = (0.5 , 0.5 )
746+ ell .set_semimajor (0.5 )
747+ ell .set_semiminor (0.3 )
748+ assert ell .radii == (0.5 , 0.3 )
749+ ell .width = 0.1
750+ ell .angle = 45
751+
752+
726753def test_degenerate_polygon ():
727754 point = [0 , 0 ]
728755 correct_extents = Bbox ([point , point ]).extents
0 commit comments