Skip to content

Commit b44c262

Browse files
adding test case for matplotlib#2744
1 parent e3796c2 commit b44c262

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/matplotlib/tests/test_lines.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,11 @@ def test_set_line_coll_dash_image():
7878

7979
np.random.seed(0)
8080
cs = ax.contour(np.random.randn(20, 30), linestyles=[(0, (3, 3))])
81+
82+
83+
def test_nan_is_sorted():
84+
# Exercises issue from PR #2744 (NaN throwing warning in _is_sorted)
85+
line = mpl.lines.Line2D([],[])
86+
assert_true(line._is_sorted(np.array([1,2,3])))
87+
assert_true(not line._is_sorted(np.array([1,np.nan,3])))
88+

0 commit comments

Comments
 (0)