# error with text object properties using matplotlib 0.98.1

Hi,

I just upgraded to matplotlib 0.98.1 on a ubuntu hardy heron system. I
have noticed two problems since the upgrade:

1) For any plot, if I try to look at the properties of a text object I
get an error related to FontProperties having no attribute 'items'. See
below:

In [1]: plot(range(10))
Out[1]: [<matplotlib.lines.Line2D object at 0x924f9ac>]

In [2]: xlh=get(gca(),'xticklabels')

In [3]: get(xlh[0])

···

------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line
724, in get
return getp(o, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line
716, in getp
print '\n'.join(insp.pprint_getters())
File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line
684, in pprint_getters
s = str(val)
File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py",
line 681, in __str__
return self.get_fontconfig_pattern()
File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py",
line 737, in get_fontconfig_pattern
return generate_fontconfig_pattern(self)
File
"/usr/lib/python2.5/site-packages/matplotlib/fontconfig_pattern.py",
line 164, in generate_fontconfig_pattern
for key, val in d.items():
<type 'exceptions.AttributeError'>: 'FontProperties' object has no
attribute 'items'

2) I have noticed that the font used for the xticklabels and the font
used for the xlabel and contour labels appears to be different (example
attached). One appears to be serif and the other sans-serif. This
seems to be due to using tex for text rendering. I am not sure if this
also occurred before the update, but I didn't notice it previously.
Looking at the properties of the different text objects, it isn't
apparent that there should be a difference - both have font properties
that indicate sans-serif, but the text of tick labels appears to be
surrounded by $'s forcing it through the text parser, while that of the contour labels is not. Is this difference normal or expected? Is there a way around this? In particular, I would like to use sans-serif for everything - is this possible while still using tex? Thanks for the assistance. Cheers, David -- ********************************** David M. Kaplan Charge de Recherche 1 Institut de Recherche pour le Developpement Centre de Recherche Halieutique Mediterraneenne et Tropicale av. Jean Monnet B.P. 171 34203 Sete cedex France Phone: +33 (0)4 99 57 32 27 Fax: +33 (0)4 99 57 32 95 http://www.ur097.ird.fr/team/dkaplan/index.html ********************************** David M. Kaplan wrote: Hi, I just upgraded to matplotlib 0.98.1 on a ubuntu hardy heron system. I have noticed two problems since the upgrade: 1) For any plot, if I try to look at the properties of a text object I get an error related to FontProperties having no attribute 'items'. See below: In [1]: plot(range(10)) Out[1]: [<matplotlib.lines.Line2D object at 0x924f9ac>] In [2]: xlh=get(gca(),'xticklabels') In [3]: get(xlh[0]) ------------------------------------------------------------ Traceback (most recent call last): File "<ipython console>", line 1, in <module> File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line 724, in get return getp(o, *args, **kwargs) File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line 716, in getp print '\n'.join(insp.pprint_getters()) File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line 684, in pprint_getters s = str(val) File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py", line 681, in __str__ return self.get_fontconfig_pattern() File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py", line 737, in get_fontconfig_pattern return generate_fontconfig_pattern(self) File "/usr/lib/python2.5/site-packages/matplotlib/fontconfig_pattern.py", line 164, in generate_fontconfig_pattern for key, val in d.items(): <type 'exceptions.AttributeError'>: 'FontProperties' object has no attribute 'items' Thanks for the report. This is a bug and should now be fixed in SVN. 2) I have noticed that the font used for the xticklabels and the font used for the xlabel and contour labels appears to be different (example attached). One appears to be serif and the other sans-serif. This seems to be due to using tex for text rendering. I am not sure if this also occurred before the update, but I didn't notice it previously. Looking at the properties of the different text objects, it isn't apparent that there should be a difference - both have font properties that indicate sans-serif, but the text of tick labels appears to be surrounded by$'s forcing it through the text parser, while that of the
contour labels is not. Is this difference normal or expected? Is there
a way around this? In particular, I would like to use sans-serif for
everything - is this possible while still using tex?

To clarify -- you've set the rcParam "text.usetex" to True?

If the tick labels are in fact surrounded by $'s, then, yes, TeX will render then in a serif font. This is the default behavior of TeX (math is in a serif font) -- though there might be a special package you could add to the preamble (the rcParam text.latex.preamble) to change this, but that's more of a (La)TeX issue. Looking at the revision history, it looks like putting$'s around tick labels has been done since at least 0.90.1.

Perhaps one of the usetex developers/users has more insight into this than I do.

Cheers,
Mike

···

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi David,

2) I have noticed that the font used for the xticklabels and the font
used for the xlabel and contour labels appears to be different (example
attached). One appears to be serif and the other sans-serif. This
seems to be due to using tex for text rendering. I am not sure if this
also occurred before the update, but I didn't notice it previously.

It has always been this way. We tried a workaround once a couple years back
and it turned into a real mess.

Looking at the properties of the different text objects, it isn't
apparent that there should be a difference - both have font properties
that indicate sans-serif, but the text of tick labels appears to be
surrounded by $'s forcing it through the text parser, while that of the contour labels is not. Is this difference normal or expected? Is there a way around this? In particular, I would like to use sans-serif for everything - is this possible while still using tex? I think there is a package, sansmath or something like that, that will allow latex to use sans-serif fonts in math mode. You could try adding it to the text.latex.preamble rc setting, but that option is not officially supported. If you don't like the limitations of latex, you might want to turning off usetex and just use matplotlibs mathtext, which recently got a significant rewrite and is now quite capable thanks to Mike Droettboom. Here's some documentation too: http://matplotlib.sourceforge.net/doc/html/users/mathtext.html Darren ··· On Thursday 10 July 2008 11:15:37 am David M. Kaplan wrote: Hi, Thanks for the suggestions. I have stopped using the usetex option. To make math and normal text match, I tried the following: rcParams['font.family'] = 'serif' rcParams['mathtext.fontset'] = 'stix' This didn't make them match - normal text looked to me like it was still sans-serif, while mathtext was with serif. Is there something else I should be doing to make this happen? Thanks again for your help. Cheers, David ··· On Thu, 2008-07-10 at 11:52 -0400, Darren Dale wrote: Hi David, On Thursday 10 July 2008 11:15:37 am David M. Kaplan wrote: > 2) I have noticed that the font used for the xticklabels and the font > used for the xlabel and contour labels appears to be different (example > attached). One appears to be serif and the other sans-serif. This > seems to be due to using tex for text rendering. I am not sure if this > also occurred before the update, but I didn't notice it previously. It has always been this way. We tried a workaround once a couple years back and it turned into a real mess. > Looking at the properties of the different text objects, it isn't > apparent that there should be a difference - both have font properties > that indicate sans-serif, but the text of tick labels appears to be > surrounded by$'s forcing it through the text parser, while that of the
> contour labels is not. Is this difference normal or expected? Is there
> a way around this? In particular, I would like to use sans-serif for
> everything - is this possible while still using tex?

I think there is a package, sansmath or something like that, that will allow
latex to use sans-serif fonts in math mode. You could try adding it to the
text.latex.preamble rc setting, but that option is not officially supported.

If you don't like the limitations of latex, you might want to turning off
usetex and just use matplotlibs mathtext, which recently got a significant
rewrite and is now quite capable thanks to Mike Droettboom. Here's some
documentation too:
http://matplotlib.sourceforge.net/doc/html/users/mathtext.html

Darren

--
**********************************
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France

Phone: +33 (0)4 99 57 32 27
Fax: +33 (0)4 99 57 32 95
http://www.ur097.ird.fr/team/dkaplan/index.html
**********************************

Hi,

Thanks for the suggestions. I have stopped using the usetex option. To
make math and normal text match, I tried the following:

rcParams['font.family'] = 'serif'
rcParams['mathtext.fontset'] = 'stix'

This didn't make them match - normal text looked to me like it was still
sans-serif, while mathtext was with serif. Is there something else I
should be doing to make this happen?

Cheers,
David

···

On Thu, 2008-07-10 at 11:52 -0400, Darren Dale wrote:

Hi David,

On Thursday 10 July 2008 11:15:37 am David M. Kaplan wrote:
> 2) I have noticed that the font used for the xticklabels and the font
> used for the xlabel and contour labels appears to be different (example
> attached). One appears to be serif and the other sans-serif. This
> seems to be due to using tex for text rendering. I am not sure if this
> also occurred before the update, but I didn't notice it previously.

It has always been this way. We tried a workaround once a couple years back
and it turned into a real mess.

> Looking at the properties of the different text objects, it isn't
> apparent that there should be a difference - both have font properties
> that indicate sans-serif, but the text of tick labels appears to be
> surrounded by $'s forcing it through the text parser, while that of the > contour labels is not. Is this difference normal or expected? Is there > a way around this? In particular, I would like to use sans-serif for > everything - is this possible while still using tex? I think there is a package, sansmath or something like that, that will allow latex to use sans-serif fonts in math mode. You could try adding it to the text.latex.preamble rc setting, but that option is not officially supported. If you don't like the limitations of latex, you might want to turning off usetex and just use matplotlibs mathtext, which recently got a significant rewrite and is now quite capable thanks to Mike Droettboom. Here's some documentation too: http://matplotlib.sourceforge.net/doc/html/users/mathtext.html Darren -- ********************************** David M. Kaplan Charge de Recherche 1 Institut de Recherche pour le Developpement Centre de Recherche Halieutique Mediterraneenne et Tropicale av. Jean Monnet B.P. 171 34203 Sete cedex France Phone: +33 (0)4 99 57 32 27 Fax: +33 (0)4 99 57 32 95 http://www.ur097.ird.fr/team/dkaplan/index.html ********************************** -- ********************************** David M. Kaplan Assistant Researcher UCSC / Institute of Marine Sciences Ocean Sciences 1156 High St. SC, CA 95064 Phone: 831-459-4789 Fax: 831-459-4882 http://pmc.ucsc.edu/~dmk/ ********************************** This works for me. Could you set the rcParam verbose.level to debug-annoying and send the output -- that will print some information about where it's looking for fonts and what it can and can not find. Cheers, Mike David M. Kaplan wrote: ··· Hi, Thanks for the suggestions. I have stopped using the usetex option. To make math and normal text match, I tried the following: rcParams['font.family'] = 'serif' rcParams['mathtext.fontset'] = 'stix' This didn't make them match - normal text looked to me like it was still sans-serif, while mathtext was with serif. Is there something else I should be doing to make this happen? Thanks again for your help. Cheers, David On Thu, 2008-07-10 at 11:52 -0400, Darren Dale wrote: Hi David, On Thursday 10 July 2008 11:15:37 am David M. Kaplan wrote: 2) I have noticed that the font used for the xticklabels and the font used for the xlabel and contour labels appears to be different (example attached). One appears to be serif and the other sans-serif. This seems to be due to using tex for text rendering. I am not sure if this also occurred before the update, but I didn't notice it previously. It has always been this way. We tried a workaround once a couple years back and it turned into a real mess. Looking at the properties of the different text objects, it isn't apparent that there should be a difference - both have font properties that indicate sans-serif, but the text of tick labels appears to be surrounded by$'s forcing it through the text parser, while that of the
contour labels is not. Is this difference normal or expected? Is there
a way around this? In particular, I would like to use sans-serif for
everything - is this possible while still using tex?

I think there is a package, sansmath or something like that, that will allow latex to use sans-serif fonts in math mode. You could try adding it to the text.latex.preamble rc setting, but that option is not officially supported.

If you don't like the limitations of latex, you might want to turning off usetex and just use matplotlibs mathtext, which recently got a significant rewrite and is now quite capable thanks to Mike Droettboom. Here's some documentation too:
http://matplotlib.sourceforge.net/doc/html/users/mathtext.html

Darren

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi,

I gave this a shot, but it didn't print anything out. Attached is an
example of a plot where the fonts don't match.

In [4]: rcParams['verbose.level']='debug-annoying'

In [5]: rcParams['mathtext.fontset'] = 'stix'

In [6]: rcParams['font.family'] = 'serif'

In [7]: plot(arange(10))
Out[7]: [<matplotlib.lines.Line2D object at 0x92b162c>]

In [8]: text(1,7,r'$1 \alpha$')
Out[8]: <matplotlib.text.Text object at 0x8f047cc>

In [9]: text(1,3,'1 alpha')
Out[9]: <matplotlib.text.Text object at 0x92c4c0c>

In [10]: savefig('test.eps')

Thanks,
David

test.eps (20.3 KB)

···

On Fri, 2008-07-11 at 09:35 -0400, Michael Droettboom wrote:

This works for me. Could you set the rcParam verbose.level to
debug-annoying and send the output -- that will print some information
about where it's looking for fonts and what it can and can not find.

Cheers,
Mike

David M. Kaplan wrote:
> Hi,
>
> Thanks for the suggestions. I have stopped using the usetex option. To
> make math and normal text match, I tried the following:
>
> rcParams['font.family'] = 'serif'
> rcParams['mathtext.fontset'] = 'stix'
>
> This didn't make them match - normal text looked to me like it was still
> sans-serif, while mathtext was with serif. Is there something else I
> should be doing to make this happen?
>
> Thanks again for your help.
>
> Cheers,
> David
>
>
> On Thu, 2008-07-10 at 11:52 -0400, Darren Dale wrote:
>
>> Hi David,
>>
>> On Thursday 10 July 2008 11:15:37 am David M. Kaplan wrote:
>>
>>> 2) I have noticed that the font used for the xticklabels and the font
>>> used for the xlabel and contour labels appears to be different (example
>>> attached). One appears to be serif and the other sans-serif. This
>>> seems to be due to using tex for text rendering. I am not sure if this
>>> also occurred before the update, but I didn't notice it previously.
>>>
>> It has always been this way. We tried a workaround once a couple years back
>> and it turned into a real mess.
>>
>>
>>> Looking at the properties of the different text objects, it isn't
>>> apparent that there should be a difference - both have font properties
>>> that indicate sans-serif, but the text of tick labels appears to be
>>> surrounded by $'s forcing it through the text parser, while that of the >>> contour labels is not. Is this difference normal or expected? Is there >>> a way around this? In particular, I would like to use sans-serif for >>> everything - is this possible while still using tex? >>> >> I think there is a package, sansmath or something like that, that will allow >> latex to use sans-serif fonts in math mode. You could try adding it to the >> text.latex.preamble rc setting, but that option is not officially supported. >> >> If you don't like the limitations of latex, you might want to turning off >> usetex and just use matplotlibs mathtext, which recently got a significant >> rewrite and is now quite capable thanks to Mike Droettboom. Here's some >> documentation too: >> http://matplotlib.sourceforge.net/doc/html/users/mathtext.html >> >> Darren >> -- ********************************** David M. Kaplan Assistant Researcher UCSC / Institute of Marine Sciences Ocean Sciences 1156 High St. SC, CA 95064 Phone: 831-459-4789 Fax: 831-459-4882 http://pmc.ucsc.edu/~dmk/ ********************************** Sorry -- I forgot to mention that you need to put the verbose.level argument in your matplotlibrc file -- it can't be changed once matplotlib has been imported. Thanks, Mike David M. Kaplan wrote: ··· Hi, I gave this a shot, but it didn't print anything out. Attached is an example of a plot where the fonts don't match. In [4]: rcParams['verbose.level']='debug-annoying' In [5]: rcParams['mathtext.fontset'] = 'stix' In [6]: rcParams['font.family'] = 'serif' In [7]: plot(arange(10)) Out[7]: [<matplotlib.lines.Line2D object at 0x92b162c>] In [8]: text(1,7,r'$1 \alpha$') Out[8]: <matplotlib.text.Text object at 0x8f047cc> In [9]: text(1,3,'1 alpha') Out[9]: <matplotlib.text.Text object at 0x92c4c0c> In [10]: savefig('test.eps') Thanks, David On Fri, 2008-07-11 at 09:35 -0400, Michael Droettboom wrote: This works for me. Could you set the rcParam verbose.level to debug-annoying and send the output -- that will print some information about where it's looking for fonts and what it can and can not find. Cheers, Mike David M. Kaplan wrote: Hi, Thanks for the suggestions. I have stopped using the usetex option. To make math and normal text match, I tried the following: rcParams['font.family'] = 'serif' rcParams['mathtext.fontset'] = 'stix' This didn't make them match - normal text looked to me like it was still sans-serif, while mathtext was with serif. Is there something else I should be doing to make this happen? Thanks again for your help. Cheers, David On Thu, 2008-07-10 at 11:52 -0400, Darren Dale wrote: Hi David, On Thursday 10 July 2008 11:15:37 am David M. Kaplan wrote: 2) I have noticed that the font used for the xticklabels and the font used for the xlabel and contour labels appears to be different (example attached). One appears to be serif and the other sans-serif. This seems to be due to using tex for text rendering. I am not sure if this also occurred before the update, but I didn't notice it previously. It has always been this way. We tried a workaround once a couple years back and it turned into a real mess. Looking at the properties of the different text objects, it isn't apparent that there should be a difference - both have font properties that indicate sans-serif, but the text of tick labels appears to be surrounded by$'s forcing it through the text parser, while that of the
contour labels is not. Is this difference normal or expected? Is there
a way around this? In particular, I would like to use sans-serif for
everything - is this possible while still using tex?

I think there is a package, sansmath or something like that, that will allow latex to use sans-serif fonts in math mode. You could try adding it to the text.latex.preamble rc setting, but that option is not officially supported.

If you don't like the limitations of latex, you might want to turning off usetex and just use matplotlibs mathtext, which recently got a significant rewrite and is now quite capable thanks to Mike Droettboom. Here's some documentation too:
http://matplotlib.sourceforge.net/doc/html/users/mathtext.html

Darren

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

I'm surprised. That works for me. Can you (again) set verbose.level to "debug-annoying" and send the output?

Cheers,
Mike

David M. Kaplan wrote:

···

Hi,

Thanks for the suggestions. I have stopped using the usetex option. To
make math and normal text match, I tried the following:

rcParams['font.family'] = 'serif'
rcParams['mathtext.fontset'] = 'stix'

This didn't make them match - normal text looked to me like it was still
sans-serif, while mathtext was with serif. Is there something else I
should be doing to make this happen?

Cheers,
David

On Thu, 2008-07-10 at 11:52 -0400, Darren Dale wrote:

Hi David,

On Thursday 10 July 2008 11:15:37 am David M. Kaplan wrote:

2) I have noticed that the font used for the xticklabels and the font
used for the xlabel and contour labels appears to be different (example
attached). One appears to be serif and the other sans-serif. This
seems to be due to using tex for text rendering. I am not sure if this
also occurred before the update, but I didn't notice it previously.

It has always been this way. We tried a workaround once a couple years back and it turned into a real mess.

Looking at the properties of the different text objects, it isn't
apparent that there should be a difference - both have font properties
that indicate sans-serif, but the text of tick labels appears to be
surrounded by \$'s forcing it through the text parser, while that of the
contour labels is not. Is this difference normal or expected? Is there
a way around this? In particular, I would like to use sans-serif for
everything - is this possible while still using tex?

I think there is a package, sansmath or something like that, that will allow latex to use sans-serif fonts in math mode. You could try adding it to the text.latex.preamble rc setting, but that option is not officially supported.

If you don't like the limitations of latex, you might want to turning off usetex and just use matplotlibs mathtext, which recently got a significant rewrite and is now quite capable thanks to Mike Droettboom. Here's some documentation too:
http://matplotlib.sourceforge.net/doc/html/users/mathtext.html

Darren

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi,

The output from using debug-annoying is attached. It all looks
relatively normal to me, but perhaps you will see something I don't. I
am thinking that the problem is the difference between Bitstream Serif
and the STIX fonts - they are just different. Perhaps you can suggest a
way to change say the fontfamilies that will make them agree.

Thanks,
David

tmp.txt (14.9 KB)

···

--
**********************************
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France

Phone: +33 (0)4 99 57 32 27
Fax: +33 (0)4 99 57 32 95
http://www.ur097.ird.fr/team/dkaplan/index.html
**********************************

I thought you said the normal text looked sans-serif. The debugging output seems to suggest otherwise. Maybe you can send me the generated plot as well.

The default serif font, Bitstream Vera Serif, is not an identical match to the STIX fonts. The STIX fonts are designed to match Times. If you have Times (or Times New Roman) installed on your system you can set "font.serif" to "Times" in your matplotlibrc. That may help the fonts match better.

Cheers,
Mike

David Kaplan wrote:

···

Hi,

The output from using debug-annoying is attached. It all looks
relatively normal to me, but perhaps you will see something I don't. I
am thinking that the problem is the difference between Bitstream Serif
and the STIX fonts - they are just different. Perhaps you can suggest a
way to change say the fontfamilies that will make them agree.

Thanks,
David

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi,

I guess the problem was mostly mine. To my eyes, the Bitstream Vera
Serif doesn't look very "serif" to me (figure attached), but I am
probably just not used to that font. Changing font.serif as suggested
produced much more similar output. Thanks and sorry for the unnecessary
confusion.

However, this brought me to another strange problem. When I added a
matplotlibrc file to ~/.matplotlib/ and ran ipython -pylab, none of my
graphic screens appear (i.e., figure() produces no visible window).
Plotting works and I can save figures, but they just are not visible.
It makes no difference what is in the matplotlibrc, an empty file
produces the same result as a file with directives in it. Removing
matplotlibrc allows me to see the plot window. Does this make any
sense?

Just in case it matters, I am currently using the svn trunk of
matplotlib.

Cheers,
David

test2.eps (33.3 KB)

···

On Tue, 2008-07-15 at 08:06 -0400, Michael Droettboom wrote:

I thought you said the normal text looked sans-serif. The debugging
output seems to suggest otherwise. Maybe you can send me the generated
plot as well.

The default serif font, Bitstream Vera Serif, is not an identical match
to the STIX fonts. The STIX fonts are designed to match Times. If you
have Times (or Times New Roman) installed on your system you can set
"font.serif" to "Times" in your matplotlibrc. That may help the fonts
match better.

Cheers,
Mike

David Kaplan wrote:
> Hi,
>
> The output from using debug-annoying is attached. It all looks
> relatively normal to me, but perhaps you will see something I don't. I
> am thinking that the problem is the difference between Bitstream Serif
> and the STIX fonts - they are just different. Perhaps you can suggest a
> way to change say the fontfamilies that will make them agree.
>
> Thanks,
> David
>
>
>
>

--
**********************************
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France

Phone: +33 (0)4 99 57 32 27
Fax: +33 (0)4 99 57 32 95
http://www.ur097.ird.fr/team/dkaplan/index.html
**********************************

Agg appears to be your default backend. You can set a GUI backend in your
matplotlibrc and then you will get your windows back.

Darren

···

On Tuesday 15 July 2008 09:22:10 am David Kaplan wrote:

Hi,

I guess the problem was mostly mine. To my eyes, the Bitstream Vera
Serif doesn't look very "serif" to me (figure attached), but I am
probably just not used to that font. Changing font.serif as suggested
produced much more similar output. Thanks and sorry for the unnecessary
confusion.

However, this brought me to another strange problem. When I added a
matplotlibrc file to ~/.matplotlib/ and ran ipython -pylab, none of my
graphic screens appear (i.e., figure() produces no visible window).
Plotting works and I can save figures, but they just are not visible.
It makes no difference what is in the matplotlibrc, an empty file
produces the same result as a file with directives in it. Removing
matplotlibrc allows me to see the plot window. Does this make any
sense?