Localization in mpl

Jesper Larsen <jesper.webmail@...287...> writes:

wind = u'\u98ce'
p.title(wind)

But there is just a box instead of the proper character on the plot.
Any ideas what went wrong? Do I have to use a special font?

Of course you need a font that contains the Chinese characters you are
using. I have no idea whether matplotlib has any issues with such fonts
(though I think e.g. OpenType is only partially supported), but getting
a box sounds like the font does not have the character you need.

I also tried using TeX following the example here:
http://matplotlib.sourceforge.net/examples/pylab_examples/tex_unicode_demo.html
but it did not work when I put in Chinese symbols.

TeX's Unicode support is not at all complete - matplotlib merely selects
the utf8 input encoding, which isn't enough to make TeX work with Chinese.
Perhaps the instructions http://www.math.nus.edu.sg/aslaksen/cs/cjk.html
will get you started if you want to go the TeX route.

···

--
Jouni K. Sepp�nen