Font by default

Hello,

I am using matplotlib under Fedora 8 and since an updaet I just realised
that the default font seems to be serif raher than the previously roman
font used in LaTeX, as some people observed it also ?

How can I come back to the previous font using the simplest solution ?

Thanks in advance for your help,

FF

I am not sure what font you used previously, but you can use the
font.family setting in the matplotlibrc file (copy this file from
site-packages/matplotlib/mpl-data/matplotlibrc you your home directory
in the ~/.matplotlib directory and edit it. Eg.

  font.family : sans-serif # for san serif

Since you mentioned latex, you can use latex to generate all the fonts
in matplotlib by enabling usetex in matplotlibrc , provided you have
latex and dvipng installed.

  text.usetex : True

Finally, if you run your matplotlib test script with --verbose-debug
you will get lots of extra information about what settings are used
and what fonts are loaded.

JDH

···

On Mon, May 26, 2008 at 8:32 AM, Florent Fayette <fayette@...2021...> wrote:

Hello,

I am using matplotlib under Fedora 8 and since an updaet I just realised
that the default font seems to be serif raher than the previously roman
font used in LaTeX, as some people observed it also ?

How can I come back to the previous font using the simplest solution ?

Hi,

Thanks for the help but I used the tricks you told me and it's not workign
either, I removed matlpotlib and reinstalled it and I still have the same
different font.

On the other hand on a different computer having the same distribution
(fedora 8) BUT not up to date in the packages and things work just fine.

Maybe it comes from LaTeX, does Matplotlib rely on the LaTeX software or
does it own his own version somehow hardcoded.

Thanks,

FF

···

On Mon, 26 May 2008, John Hunter wrote:

On Mon, May 26, 2008 at 8:32 AM, Florent Fayette <fayette@...2021...> wrote:
> Hello,
>
> I am using matplotlib under Fedora 8 and since an updaet I just realised
> that the default font seems to be serif raher than the previously roman
> font used in LaTeX, as some people observed it also ?
>
> How can I come back to the previous font using the simplest solution ?

I am not sure what font you used previously, but you can use the
font.family setting in the matplotlibrc file (copy this file from
site-packages/matplotlib/mpl-data/matplotlibrc you your home directory
in the ~/.matplotlib directory and edit it. Eg.

  font.family : sans-serif # for san serif

Since you mentioned latex, you can use latex to generate all the fonts
in matplotlib by enabling usetex in matplotlibrc , provided you have
latex and dvipng installed.

  text.usetex : True

Finally, if you run your matplotlib test script with --verbose-debug
you will get lots of extra information about what settings are used
and what fonts are loaded.

JDH

Maybe it comes from LaTeX, does Matplotlib rely on the LaTeX software or
does it own his own version someh text.usetex : Trueow hardcoded.

It does both. If text.usetex is False, we use our own fonts and
text layout algorithms, which can look quite similar to latex because
we ship some of the computer modern fonts. If text.usetex is True, we
call out to latex and dvipng. If you post the output with the
--verbose-debug flag set, we would know better what is going on on
your system

python simple_plot.py --verbose-debug > run.out

and post run.out.

JDH

···

On Tue, May 27, 2008 at 2:50 AM, Florent Fayette <fayette@...2021...> wrote:

Hi,

Here is what I get when using the verbose mode, since removing and
installing over again Matplotlib didn't vhanged anything I suspect my
LaTeX packages might be responsible,...

Thanks in advance for any help

$HOME=/home/fayette
CONFIGDIR=/home/fayette/.matplotlib
matplotlib data path /usr/lib/python2.5/site-packages/matplotlib/mpl-data
loaded rc file
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/matplotlibrc
matplotlib version 0.91.2
verbose.level debug
interactive is False
units is False
platform is linux2
loaded modules: ['_bisect', 'xml.sax.urlparse', 'distutils', 'pylab',
'datetime', 'matplotlib.tempfile', 'distutils.sysconfig',
'encodings.encodings', '_numpy', 'xml', 'struct', 'tempfile',
'xml.sax.urllib', 'pytz.os', 'matplotlib.matplotlib', 'string',
'encodings.utf_8', 'matplotlib.__future__', 'pytz.tzinfo',
'pytz.datetime', 'distutils.re', 'bisect', 'signal', 'Numeric', 'random',
'xml.sax.xmlreader', 'matplotlib.pytz', 'ArrayPrinter', 'locale',
'xml.sax.saxutils', 'encodings', 'umath', 'dateutil',
'matplotlib.warnings', 'matplotlib.string', 'pytz.pytz', 'urllib',
'matplotlib.sys', 're', 'new', 'math', 'numeric_version', 'fcntl',
'UserDict', 'xml.sax.types', 'distutils.os', 'matplotlib', 'base',
'codecs', 'paste', 'md5', '_locale', 'matplotlib.sre_constants',
'matplotlib.os', 'thread', 'StringIO', 'weakref', 'itertools',
'distutils.sys', 'os', 'marshal', '__future__', 'matplotlib.copy',
'cStringIO', '_sre', '__builtin__', 'matplotlib.re', 'operator',
'distutils.string', 'matplotlib.datetime', 'posixpath', 'errno',
'_socket', 'binascii', 'Precision', 'sre_constants', 'matplotlib.md5',
'types', 'pytz.sys', 'xml.sax.handler', 'xml.sax.os', 'matplotlib.xml',
'multiarray', '_codecs', 'pytz', 'matplotlib.pyparsing', 'copy',
'_struct', '_types', 'matplotlib.dateutil', 'hashlib', 'posix',
'encodings.aliases', 'matplotlib.distutils', 'exceptions', 'sre_parse',
'pytz.bisect', 'pickle', 'distutils.distutils', 'copy_reg', 'sre_compile',
'xml.sax', '_hashlib', '_random', 'site', 'zipimport', '__main__',
'shutil', 'matplotlib.weakref', 'strop', 'encodings.codecs', 'gettext',
'matplotlib.rcsetup', 'pytz.sets', 'xml.sax._exceptions',
'xml.sax.codecs', 'stat', '_ssl', 'warnings', 'encodings.types', 'sets',
'sys', 'socket', 'xml.sax.sys', 'os.path', 'pytz.gettext',
'matplotlib.fontconfig_pattern', '_weakref', 'distutils.errors',
'urlparse', 'linecache', 'matplotlib.shutil', 'time']
numerix numpy 1.0.3.1
Using fontManager instance from
/home/fayette/.matplotlib/fontManager.cache
backend GTKAgg version 2.12.0

···

==========================================================================================================
Matplotlib processing for :
/home/fayette/LaTeX/ASCII_data_files/2008-04--Wp_vs_Wm_test12/SL4_64_200Mo_std/ppb_up_wp_xx_phys01_pdf10150_mw00_yW_VS_ppb_up_wm_xx_phys01_pdf10150_mw00_yW.dat

   > Reading :
/home/fayette/LaTeX/ASCII_data_files/2008-04--Wp_vs_Wm_test12/SL4_64_200Mo_std/ppb_up_wp_xx_phys01_pdf10150_mw00_yW_VS_ppb_up_wm_xx_phys01_pdf10150_mw00_yW.dat
   > Drawing !
   > Saving :
./eps_pdf/ppb_up_wp_xx_phys01_pdf10150_mw00_yW_VS_ppb_up_wm_xx_phys01_pdf10150_mw00_yW.eps
Found dvipng version 1.5
cd "/tmp" && latex -interaction=nonstopmode
"/tmp/43f2d14607397712890028dfdf3f25ac.tex" >
"/tmp/43f2d14607397712890028dfdf3f25ac.output"
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
entering extended mode
(/tmp/43f2d14607397712890028dfdf3f25ac.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german,
ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch,
esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk,
polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish,
swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/type1cm/type1cm.sty)
(/usr/share/texmf/tex/latex/psnfss/helvet.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty))
(/usr/share/texmf/tex/latex/psnfss/courier.sty)
(/usr/share/texmf/tex/latex/base/textcomp.sty
(/usr/share/texmf/tex/latex/base/ts1enc.def))
(/usr/share/texmf/tex/latex/geometry/geometry.sty
(/usr/share/texmf/tex/latex/geometry/geometry.cfg)

Package geometry Warning: Over-specification in `h'-direction.
    `width' (614.295pt) is ignored.

Package geometry Warning: Over-specification in `v'-direction.
    `height' (794.96999pt) is ignored.

) (/usr/share/texmf/tex/latex/psfrag/psfrag.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/share/texmf/tex/latex/graphics/graphics.cfg)
(/usr/share/texmf/tex/latex/graphics/dvips.def)))
(/usr/share/texmf/tex/latex/graphics/graphicx.sty)
(/usr/share/texmf/tex/latex/graphics/color.sty
(/usr/share/texmf/tex/latex/graphics/color.cfg)
(/usr/share/texmf/tex/latex/graphics/dvipsnam.def))
No file 43f2d14607397712890028dfdf3f25ac.aux.
(/usr/share/texmf/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf/tex/latex/psnfss/ot1pnc.fd)
<43f2d14607397712890028dfdf3f25ac.eps>
(/usr/share/texmf/tex/latex/psnfss/ot1phv.fd) [1]
(./43f2d14607397712890028dfdf3f25ac.aux) )
Output written on 43f2d14607397712890028dfdf3f25ac.dvi (1 page, 5996
bytes).
Transcript written on 43f2d14607397712890028dfdf3f25ac.log.

cd "/tmp" && dvips -q -R0 -o "43f2d14607397712890028dfdf3f25ac.ps"
"43f2d14607397712890028dfdf3f25ac.dvi" >
"/tmp/43f2d14607397712890028dfdf3f25ac.output"

gs -dBATCH -dNOPAUSE -r6000 -sDEVICE=pswrite -sPAPERSIZE=letter
-sOutputFile="/tmp/43f2d14607397712890028dfdf3f25ac.ps"
"/tmp/43f2d14607397712890028dfdf3f25ac" >
"/tmp/43f2d14607397712890028dfdf3f25ac.output"
GPL Ghostscript 8.61 (2007-11-21)
Copyright (C) 2007 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusSanL-Regu font from
/usr/share/fonts/default/Type1/n019003l.pfb... 2703240 1112639 2569336
1264022 1 done.
Loading CenturySchL-Roma font from
/usr/share/fonts/default/Type1/c059013l.pfb... 2746924 1245014 2589432
1296705 1 done.

gs -dBATCH -dNOPAUSE -sDEVICE=bbox "/tmp/43f2d14607397712890028dfdf3f25ac"
%%BoundingBox: 15 188 578 615
%%HiResBoundingBox: 15.986742 188.125799 577.219975 614.267981

  findfont found Bitstream Vera Sans, normal, normal 400, normal,
15.0
findfont returning
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf
  findfont found Bitstream Vera Sans, normal, normal 400, normal,
20.0
findfont returning
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf

On Tue, 27 May 2008, John Hunter wrote:

On Tue, May 27, 2008 at 2:50 AM, Florent Fayette <fayette@...2021...> wrote:

> Maybe it comes from LaTeX, does Matplotlib rely on the LaTeX software or
> does it own his own version someh text.usetex : Trueow hardcoded.

It does both. If text.usetex is False, we use our own fonts and
text layout algorithms, which can look quite similar to latex because
we ship some of the computer modern fonts. If text.usetex is True, we
call out to latex and dvipng. If you post the output with the
--verbose-debug flag set, we would know better what is going on on
your system

> python simple_plot.py --verbose-debug > run.out

and post run.out.

JDH