From: David <ld...@gm...> - 2010-03-18 19:34:38
|
Dear Mike, dear list, thanks for the continued help! Here are my 'news': On 18/03/10 22:22, Michael Droettboom wrote: >> import matplotlib >> matplotlib.use('GtkCairo') >> >> Incidentally, if I uncomment those two lines, then the (Western) font >> of my graph actually changes. > I'm completely stumped by this. Just now I couldn't reproduce this. However, the fonts in the png and eps are quite different. When I run my dea.py with the attached matplotlibrc, then I get both a png and an eps, however, the Chinese is still not rendered (see attachments) I noticed the following in the ~rc: cairo.format : png # png, ps, pdf, svg But having it in or out makes no difference. I > do see in the matplotlibrc that you attached that the "TkAgg" backend is > being specified, not "GtkCairo". I changed this now. > > I am able to get the Cairo backend to work just fine using matplotlib > 0.99.0. What version of cairo and pycairo do you have installed? python-cairo: 1.8.6-1ubuntu1 In [15]: cairo.version Out[15]: '1.8.6' I wasn't able to find pycairo on my system (even after installing python-cairo-dev). I belive pycairo and python-cairo are in fact the same thing. Google found this: "Just for your info if your interested in programming with cairo on ubuntu. I wanted to add svg, ps and pdf support to cairo (the ubuntu packages don't support these cairo render backends yet.)" https://wiki.ubuntu.com/CairoPythonUbuntu Could this be the reason for my troubles (under Ubuntu)? >>>> ps.fonttype=42 >>>> pdf.fonttype=42 >> >> I haven taken those out again, because I got an error message. > The error message may be related to using '=' rather than a ':'. In any > case, these settings don't affect by the Cairo backend so should have no > effect. I changed the = for a colon, yielding a nasty message: david@ubuntu:~/Documents/PhD/Dissertation/LaTeX/figures$ python dea.py /usr/lib/pymodules/python2.6/matplotlib/__init__.py:653: UserWarning: Duplicate key in file "/etc/matplotlibrc", line #329 warnings.warn('Duplicate key in file "%s", line #%d'%(fname,cnt)) Hopefully we will get to the bottom of this! I am sorry to bother you with all this -- and appreciate your efforts! Greeting from Beijing, David |