8000 Also test culling on SVG. · matplotlib/matplotlib@3182fa7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3182fa7

Browse files
committed
Also test culling on SVG.
1 parent e3e55fd commit 3182fa7

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

lib/matplotlib/tests/test_artist.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import six
55

6+
import io
7+
68
import numpy as np
79

810
import matplotlib.pyplot as plt
@@ -123,6 +125,25 @@ def test_clipping():
123125
ax1.set_ylim([-3, 3])
124126

125127

128+
@cleanup
129+
def test_cull_markers():
130+
x = np.random.random(20000)
131+
y = np.random.random(20000)
132+
133+
fig = plt.figure()
134+
ax = fig.add_subplot(111)
135+
ax.plot(x, y, 'k.')
136+
ax.set_xlim(2, 3)
137+
138+
pdf = io.BytesIO()
139+
fig.savefig(pdf, format="pdf")
140+
assert len(pdf.getvalue()) < 8000
141+
142+
svg = io.BytesIO()
143+
fig.savefig(svg, format="svg")
144+
assert len(svg.getvalue()) < 20000
145+
146+
126147
if __name__ == '__main__':
127148
import nose
128149
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,6 @@ def test_multipage_pagecount():
5454
assert pdf.get_pagecount() == 2
5555

5656

57-
@cleanup
58-
def test_cull_markers():
59-
x = np.random.random(20000)
60-
y = np.random.random(20000)
61-
62-
fig = plt.figure()
63-
ax = fig.add_subplot(111)
64-
ax.plot(x, y, 'k.')
65-
ax.set_xlim(2, 3)
66-
67-
pdf = io.BytesIO()
68-
fig.savefig(pdf, format="pdf")
69-
assert len(pdf.getvalue()) < 8000
70-
71-
7257
@cleanup
7358
def test_multipage_keep_empty():
7459
from matplotlib.backends.backend_pdf import PdfPages

0 commit comments

Comments
 (0)
0