@@ -31,6 +31,7 @@ def test_Polygon_close():
31
31
32
32
# start with open path and close it:
33
33
p = Polygon (xy , closed = True )
34
+ assert p .get_closed ()
34
35
assert_array_equal (p .get_xy (), xyclosed )
35
36
p .set_xy (xy )
36
37
assert_array_equal (p .get_xy (), xyclosed )
@@ -43,6 +44,7 @@ def test_Polygon_close():
43
44
44
45
# start with open path and leave it open:
45
46
p = Polygon (xy , closed = False )
47
+ assert not p .get_closed ()
46
48
assert_array_equal (p .get_xy (), xy )
47
49
p .set_xy (xy )
48
50
assert_array_equal (p .get_xy (), xy )
@@ -723,6 +725,31 @@ def test_annulus_setters():
723
725
ell .angle = 45
724
726
725
727
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
+
726
753
def test_degenerate_polygon ():
727
754
point = [0 , 0 ]
728
755
correct_extents = Bbox ([point , point ]).extents
0 commit comments