From: <js...@fa...> - 2006-03-29 16:55:07
|
On Wed, 29 Mar 2006 10:34:08 -0500, "Darren Dale" <dd...@co...> said: > On Tuesday 28 March 2006 19:05, you wrote: > > plotlibrc setting: > > font.sans-serif : Lucida Grande, Verdana, Geneva, Lucida, Bitstream > > Vera Sans, Arial, Helvetica, Avant Garde, sans-serif > > I get a postscript file that I cannot view. > > BUT if I change the matplotlibrc file to: > > font.sans-serif : Bitstream Vera Sans > > All goes well and the PS file is fine. This has been discussed on the > > list previously as an OS X font issue. > > > > My idea was to use the following code to set the font.sans-serif > > dynamically. > > However, it does not seem to work in that the ps file is not usable as > > if Lucida Grande was still the font.sans-serif setting. > > There might well be something very obvious - From the font manager > > code I surmised that the 'sans-serif' entry was a list but I could be > > mistaken: > > > > import matplotlib > > matplotlib.use('PS') > > from matplotlib import pylab > > import Numeric > > N = Numeric > > PL = pylab > > x = N.arrayrange(100.) > > y = N.arrayrange(100.) > > fontDict = {'family':'sans-serif', > > 'style': 'normal', > > 'variant':'normal', > > 'weight': 'medium', > > 'stretch':'normal', > > 'size': 12.0, > > 'sans-serif':['Bitstream Vera Sans']} > > PL.rc('font',**fontDict) > > PL.plot(x,y**2) > > PL.savefig('crap') > > PL.clf() > > Your second script works fine for me. I was able to switch the font in > the > postscript file, between Bitstream Vera Sans and Arial, by modifying your > fontDict. I'm using svn mpl on linux, but I dont think anything has > changed > since 0.87.2 that would effect the results. > > Are there any Mac users with a free moment to run his script? > > Darren > Darren and Jim: Works for me on 10.4. -Jeff |