Skip to content

Commit

Permalink
Fix font selection in texmanager
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Jul 30, 2013
1 parent 4b95f88 commit 89a314e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/matplotlib/texmanager.py
Expand Up @@ -169,6 +169,8 @@ def __init__(self):
ff = rcParams['font.family']
if len(ff) == 1 and ff[0].lower() in self.font_families:
self.font_family = ff[0].lower()
elif ff.lower() in self.font_families:
self.font_family = ff.lower()
else:
mpl.verbose.report(
'font.family must be one of (%s) when text.usetex is True. '
Expand Down

4 comments on commit 89a314e

@akrherz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change appears to be tripping us up some on python 2.6.6

  File "/usr/lib64/python2.6/site-packages/matplotlib/texmanager.py", line
172, in __init__
    elif ff.lower() in self.font_families:
AttributeError: 'list' object has no attribute 'lower'

@mdboom
Copy link
Member Author

@mdboom mdboom commented on 89a314e Aug 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. What is your font.family rcParam set to?

@akrherz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was our previously "working" code, but perhaps it was not correct to use.

plt.rc('text',usetex=True)
fonts = {'family':'Computer Modern','size':16}
plt.rc('font',**fonts)

@mdboom
Copy link
Member Author

@mdboom mdboom commented on 89a314e Aug 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope -- that should work. I'm looking into a solution as #2345.

Please sign in to comment.