|
From: Ojala J. <jan...@aa...> - 2013-05-15 10:40:55
|
I have a weird problem with Unicode strings. I am using windows 7 with Python 2.7.2 64 bit, and matplotlib 1.2.1 (package from Unofficial Windows Binaries at http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib ). When i run: -*- coding: utf-8 -*- import matplotlib.pyplot as plt fig = plt.figure( ) ax = fig.add_subplot(111) ax.hist([1,2,3,4,5,6,7,8,9,10], bins=range(1,11) ) plt.ylabel(u'ä') fig.savefig('test.eps') I get a crash: >pythonw -u "bugtest.py" >Exit code: -1073740777 but if i modify my code to read: -*- coding: utf-8 -*- import matplotlib.pyplot as plt fig = plt.figure( ) ax = fig.add_subplot(111) ax.hist([1,2,3,4,5,6,7,8,9,10], bins=range(1,11) ) plt.ylabel(u'äł') fig.savefig('test.eps') Then no longer crashes. Why is it that "a umlaut" alone crashes but when the string contains a "l stroke" character the Unicode string behaves fine. In both cases it works fine if I show the plot but not when I write eps either in code or when saving. |