File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
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
import matplotlib
8
- from matplotlib .testing .decorators import image_comparison , knownfailureif
10
+ from matplotlib .testing .decorators import image_comparison , knownfailureif , cleanup
9
11
import matplotlib .pyplot as plt
10
12
from matplotlib import mathtext
11
13
@@ -210,6 +212,22 @@ def test_mathtext_exceptions():
210
212
else :
211
213
assert False , "Expected '%s', but didn't get it" % msg
212
214
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
+
213
231
214
232
if __name__ == '__main__' :
215
233
import nose
You can’t perform that action at this time.
0 commit comments