File tree Expand file tree Collapse file tree 2 files changed +21
-15
lines changed Expand file tree Collapse file tree 2 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import six
5
5
6
+ import io
7
+
6
8
import numpy as np
7
9
8
10
import matplotlib .pyplot as plt
@@ -123,6 +125,25 @@ def test_clipping():
123
125
ax1 .set_ylim ([- 3 , 3 ])
124
126
125
127
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
+
126
147
if __name__ == '__main__' :
127
148
import nose
128
149
nose .runmodule (argv = ['-s' , '--with-doctest' ], exit = False )
Original file line number Diff line number Diff line change @@ -54,21 +54,6 @@ def test_multipage_pagecount():
54
54
assert pdf .get_pagecount () == 2
55
55
56
56
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
-
72
57
@cleanup
73
58
def test_multipage_keep_empty ():
74
59
from matplotlib .backends .backend_pdf import PdfPages
You can’t perform that action at this time.
0 commit comments