Skip to content

Commit 28c13f4

Browse files
committed
Just create the collection directly
1 parent 9e1b7ae commit 28c13f4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/matplotlib/tests/test_agg.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from matplotlib.figure import Figure
1515
from matplotlib.testing.decorators import cleanup
1616
from matplotlib import pyplot as plt
17+
from matplotlib import collections
18+
from matplotlib import path
1719

1820

1921
@cleanup
@@ -57,10 +59,10 @@ def test_large_single_path_collection():
5759
# would cause a segfault if the draw_markers optimization is
5860
# applied.
5961
f, ax = plt.subplots()
60-
x = np.logspace(-10, 5, 20)
61-
data = np.random.random((2, 20))
62-
ax.stackplot(x, *data)
63-
ax.set_xlim(10**-3, 1) # broken
62+
collection = collections.PathCollection(
63+
[path.Path([[-10, 5], [10, 5], [10, -5], [-10, -5], [-10, 5]])])
64+
ax.add_artist(collection)
65+
ax.set_xlim(10**-3, 1)
6466
plt.savefig(buff)
6567

6668

0 commit comments

Comments
 (0)