Skip to content

Commit 5a04eaf

Browse files
committed
TST: add test for no subslice if we have a non-standard transform
1 parent 0ba30a0 commit 5a04eaf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/matplotlib/tests/test_lines.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from matplotlib.markers import MarkerStyle
1717
from matplotlib.path import Path
1818
import matplotlib.pyplot as plt
19+
import matplotlib.transforms as mtransforms
1920
from matplotlib.testing.decorators import image_comparison, check_figures_equal
2021

2122

@@ -131,6 +132,17 @@ def test_drawstyle_variants():
131132
ax.set(xlim=(0, 2), ylim=(0, 2))
132133

133134

135+
@check_figures_equal(extensions=('png',))
136+
def test_no_subslice_with_transform(fig_ref, fig_test):
137+
ax = fig_ref.add_subplot()
138+
x = np.arange(2000)
139+
ax.plot(x + 2000, x)
140+
141+
ax = fig_test.add_subplot()
142+
t = mtransforms.Affine2D().translate(2000.0, 0.0)
143+
ax.plot(x, x, transform=t+ax.transData)
144+
145+
134146
def test_valid_drawstyles():
135147
line = mlines.Line2D([], [])
136148
with pytest.raises(ValueError):

0 commit comments

Comments
 (0)