File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from pylab import *
77import numpy as np
88from matplotlib import patches , path , transforms
9+
10+ from nose .tools import raises
11+ import cStringIO
12+
913nan = np .nan
1014Path = path .Path
1115
@@ -165,6 +169,24 @@ def test_start_with_moveto():
165169 assert len (segs ) == 1
166170 assert segs [0 ][1 ] == Path .MOVETO
167171
172+ @raises (OverflowError )
173+ def test_throw_rendering_complexity_exceeded ():
174+ rcParams ['path.simplify' ] = False
175+
176+ xx = np .arange (200000 )
177+ yy = np .random .rand (200000 )
178+ yy [1000 ] = np .nan
179+ fig = plt .figure ()
180+ ax = fig .add_subplot (111 )
181+ ax .plot (xx , yy )
182+ try :
183+ fig .savefig (cStringIO .StringIO ())
184+ except e :
185+ raise e
186+ else :
187+ rcParams ['path.simplify' ] = True
188+
189+
168190if __name__ == '__main__' :
169191 import nose
170192 nose .runmodule (argv = ['-s' ,'--with-doctest' ], exit = False )
You can’t perform that action at this time.
0 commit comments