Skip to content

Commit a32bf2e

Browse files
test nan gaps
1 parent 0a517f7 commit a32bf2e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

labellines/baseline/test_nan_gaps.png

111 KB
Loading

labellines/test.py

+14
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,20 @@ def test_nan_failure():
243243
labelLine(line, 0.5)
244244

245245

246+
@pytest.mark.mpl_image_compare
247+
def test_nan_gaps(setup_mpl):
248+
x = np.linspace(0, 10, 100)
249+
x[10:30] = np.nan
250+
251+
for i in range(10):
252+
y = np.sin(x + i)
253+
plt.plot(x, y, label=f'y={i}')
254+
255+
labelLines(plt.gca().get_lines())
256+
257+
return plt.gcf()
258+
259+
246260
@pytest.mark.mpl_image_compare
247261
def test_label_range(setup_mpl):
248262
x = np.linspace(0, 1)

0 commit comments

Comments
 (0)