Using helvetica latex fonts...

In [23]: p mp.value figure() plot([1,2,3]) title(r'Hello

    > matplotlib: $x=1+\alpha')

I assume you have another dollar sign in there in real life?

    > Running it any number of times, all the while changing
    > this:

    > In [28]: rc('font.latex',package='times')

    > to 'times', 'helvetica', etc, produces no change in the
    > generated picture. Is this setting supposed to be
    > ignored? I see that

    > http://www.scipy.org/wikis/topical_software/UsingTex

    > mentions that these parameters can be changed 'before
    > importing pylab'. Any reason why they can't be reset on
    > the fly?

No, you should be able to change them on the fly. It turns out that
agg is also doing some caching of the generated images, and this is
where the problem was (there was also one in texmanager that I fixed
yesterday). I just committed some changes that are untested but
should work. FYI, the relevant bits of the code are texmanager's
get_prefix and backend_agg's draw_tex functions. Previously in agg I
was caching on

        key = s, size, dpi, rgb, angle

and I added the rc info to the key

        key = s, size, dpi, rgb, angle, rcParams['font.latex'],rcParams['text.tex.engine']

    > AND, even worse, I'm getting consistently that if I
    > select

    > font.latex.package : helvetica

    > produces a nasty error (I can send the full tb if
    > needed):

    > RuntimeError: _image_module::readpng could not open PNG
    > file
    > /home/fperez/.matplotlib/tex.cache/4c6661ae3b1f9211424cf72e05973891_120.png
    > for reading

Flush the cache and reinstall from CVS and make sure you can repeat
this error after the newest fixes (probably still there but worth a
try). If so inspect the pointed to PNG file and see what is going on
with it: does it exist, does it have data in it, is it in fact a
readable png?

Cheers,
JDH

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.

Darren

···

On Sunday 22 January 2006 8:21 am, John Hunter wrote:

Flush the cache and reinstall from CVS and make sure you can repeat
this error after the newest fixes (probably still there but worth a
try). If so inspect the pointed to PNG file and see what is going on
with it: does it exist, does it have data in it, is it in fact a
readable png?