@@ -46,6 +46,23 @@ def test_contains_points_negative_radius():
46
46
assert np .all (result == expected )
47
47
48
48
49
+ def test_point_in_path_nan ():
50
+ box = np .array ([[0 , 0 ], [1 , 0 ], [1 , 1 ], [0 , 1 ], [0 , 0 ]])
51
+ p = Path (box )
52
+ test = np .array ([[np .nan , 0.5 ]])
53
+ contains = p .contains_points (test )
54
+ assert len (contains ) == 1
55
+ assert not contains [0 ]
56
+
57
+
58
+ def test_nonlinear_containment ():
59
+ fig , ax = plt .subplots ()
60
+ ax .set (xscale = "log" , ylim = (0 , 1 ))
61
+ polygon = ax .axvspan (1 , 10 )
62
+ assert polygon .get_path ().contains_point (
63
+ ax .transData .transform_point ((5 , .5 )), ax .transData )
64
+
65
+
49
66
@image_comparison (baseline_images = ['path_clipping' ],
50
67
extensions = ['svg' ], remove_text = True )
51
68
def test_path_clipping ():
@@ -67,15 +84,6 @@ def test_path_clipping():
67
84
xy , facecolor = 'none' , edgecolor = 'red' , closed = True ))
68
85
69
86
70
- def test_point_in_path_nan ():
71
- box = np .array ([[0 , 0 ], [1 , 0 ], [1 , 1 ], [0 , 1 ], [0 , 0 ]])
72
- p = Path (box )
73
- test = np .array ([[np .nan , 0.5 ]])
74
- contains = p .contains_points (test )
75
- assert len (contains ) == 1
76
- assert not contains [0 ]
77
-
78
-
79
87
@image_comparison (baseline_images = ['semi_log_with_zero' ], extensions = ['png' ])
80
88
def test_log_transform_with_zero ():
81
89
x = np .arange (- 10 , 10 )
0 commit comments