Using helvetica latex fonts...

I fixed a bad rcParams key in backend_agg (fixed in cvs),

    > but I still cant change the fonts on the fly. That got me
    > thinking, isn't it the case that any rcParams need to be
    > changed before importing from pylab, or has this
    > requirement changed? John's changes do work if you make rc
    > changes before importing from pylab.

rcParams is just a dict, so you can modify it and have the changes
work w/o restarting pylab. As long as the dict is being read in a
function (and not at the module import level) then you should have no
trouble changing rc on the fly as long as we get the cache keys right.

I think the changes I made to backend agg should work, but testing
will be the final arbiter. Are you seeing problems with CVS chcked
out today?

JDH

in ipython -pylab, I tried something along the lines of:

from matplotlib import rcParams
# pslatex is my default latex font package
figure()
title(r'hello matplotlib: x=e^\{i\\pi\\theta\}')
savefig('pslatex.eps')

rcParams['font.latex.package']='type1cm'
figure()
title(r'hello matplotlib: x=e^\{i\\pi\\theta\}')
savefig('type1cm.eps')

Both of these figures look the same on screen, but type1cm is used in the
epsfile. Does backend_agg read the rcParams dict during module import only?
That might explain this behavior...

Darren

···

On Sunday 22 January 2006 12:15 pm, you wrote:

    > I fixed a bad rcParams key in backend_agg (fixed in cvs),
    > but I still cant change the fonts on the fly. That got me
    > thinking, isn't it the case that any rcParams need to be
    > changed before importing from pylab, or has this
    > requirement changed? John's changes do work if you make rc
    > changes before importing from pylab.

rcParams is just a dict, so you can modify it and have the changes
work w/o restarting pylab. As long as the dict is being read in a
function (and not at the module import level) then you should have no
trouble changing rc on the fly as long as we get the cache keys right.

I think the changes I made to backend agg should work, but testing
will be the final arbiter. Are you seeing problems with CVS chcked
out today?