File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import six
55
6+ import io
7+
68import numpy as np
79
810import 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+
126147if __name__ == '__main__' :
127148 import nose
128149 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():
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
7358def test_multipage_keep_empty ():
7459 from matplotlib .backends .backend_pdf import PdfPages
You can’t perform that action at this time.
0 commit comments