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.


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to