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
79import matplotlib
8- from matplotlib .testing .decorators import image_comparison , knownfailureif
10+ from matplotlib .testing .decorators import image_comparison , knownfailureif , cleanup
911import matplotlib .pyplot as plt
1012from matplotlib import mathtext
1113
@@ -210,6 +212,22 @@ def test_mathtext_exceptions():
210212 else :
211213 assert False , "Expected '%s', but didn't get it" % msg
212214
215+ @cleanup
216+ def test_single_minus_sign ():
217+ plt .figure (figsize = (0.3 , 0.3 ))
218+ plt .text (0.5 , 0.5 , '$-$' )
219+ for spine in plt .gca ().spines .values ():
220+ spine .set_visible (False )
221+ plt .gca ().set_xticks ([])
222+ plt .gca ().set_yticks ([])
223+
224+ buff = io .BytesIO ()
225+ plt .savefig (buff , format = "rgba" , dpi = 1000 )
226+ array = np .fromstring (buff .getvalue (), dtype = np .uint8 )
227+
228+ # If this fails, it would be all white
229+ assert not np .all (array == 0xff )
230+
213231
214232if __name__ == '__main__' :
215233 import nose
You can’t perform that action at this time.
0 commit comments