|
From: Jonathan S. <js...@cf...> - 2011-12-08 13:39:49
|
Finally found a solution for this -- actually just tried solution from Piter_ <x....@gm...> in his post -- deleted fontList.cache and it works. That is, just doing rcParams['font.family'] = 'Times New Roman' gives me that font as the default. Jon > From: Michael Droettboom <md...@st...> > > > To: mat...@li... > > > Subject: Re: [Matplotlib-users] how to use different font > for serif > > > Date: Mon, 5 Dec 2011 14:49:09 -0500 > > > > > > What rcParams are you setting? > > > > > > font.family: serif > > > font.serif: Times New Roman > > > > > > and > > > > > > font.family: Times New Roman > > > > > > both work for me. > > > > > > You have to use the name of the font as specified in the > file, not > > > the filename to specify the font (which is probably why > "times" is > > > not working for you). > > > > > > Mike > > I tried both of those and just tried them again and neither > work for me: > > In [2]: rcParams['font.family'] = 'serif' > > In [3]: rcParams['font.serif'] = ['Times New Roman'] > > In [4]: plot([0,1,2]) > Out[4]: [<matplotlib.lines.Line2D object at 0x62d69d0>] > > In [5]: > /usr/local/lib/python2.6/site-packages/matplotlib/font_manager.py:1242: > UserWarning: findfont: Font family ['serif'] not found. > Falling back to > Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > > > In [7]: rcParams['font.family'] = 'Times New Roman' > > In [8]: plot([0,1,2]) > Out[8]: [<matplotlib.lines.Line2D object at 0x62ff210>] > > In [9]: > /usr/local/lib/python2.6/site-packages/matplotlib/font_manager.py:1242: > UserWarning: findfont: Font family ['Times New Roman'] not > found. > Falling back to Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > > What is it that tells the font_manager where to look? > > Jon |