Darren Dale <dd55@...143...> writes:
This morning I finished some changes to mpl's postscript and usetex options.
These changes are all available in cvs. Testing and comments appreciated.
In 0.86, which I don't think incorporates your changes[1], there is a
small problem with the text size.
The text in the postscript version is longer than in the tkagg
version, and also is not centred.
If the label is quite long, it is quite clear that in the eps version,
the text for the axis labels is not centred. I've attached a modified
version of tex_demo.py to demonstrate the effect.
Chris
[1] I did try replacing backend_ps.py with the cvs version, but it
didn't work - and I don't have time at the moment to investigate
further - probably I need to update other files too.
#!/usr/bin/env python
"""
You can use TeX to render all of your matplotlib text if the rc
parameter text.usetex is set. This works currently on the agg and ps
backends, and requires that you have tex and the other dependencies
described at http://matplotlib.sf.net/matplotlib.texmanager.html
properly installed on your system. The first time you run a script
you will see a lot of output from tex and associated tools. The next
time, the run may be silent, as a lot of the information is cached in
~/.tex.cache
"""
from matplotlib import rc
from matplotlib.numerix import arange, cos, pi
from pylab import figure, axes, plot, xlabel, ylabel, title, \
grid, savefig, show
rc('text', usetex=True)
rc('ps', usedistiller=False)
figure(1)
ax = axes([0.1, 0.1, 0.8, 0.7])
t = arange(0.0, 1.0+0.01, 0.01)
s = cos(2*2*pi*t)+2
plot(t, s)
xlabel(r'\bf{time (s) a realy long title that is not centered}')
ylabel(r'\it{voltage (mV) not centered}',fontsize=25)
title(r"\TeX\ is Number \\displaystyle\\sum\_\{n=1\}^\\infty\\frac\{\-e^\{i\\pi\}\}\{2^n\}!",
fontsize=25, color='r')
grid(True)
savefig('tex_demo.eps')
show()