LaTeX fonts

Hi all,
I’m new to Python in general and Matplotlib in particular.
I’m trying to create publication quality plots for inclusion
in LaTeX papers and presentations and have some problems
to get the fonts right.

My matplotlibrc contains the following lines

font.family : serif
font.serif : Times, Palatino, New Century Schoolbook, Bookman, Computer Modern Roman
font.sans-serif : Helvetica, Avant Garde, Computer Modern Sans serif

font.cursive
: Zapf Chancery
font.monospace : Courier, Computer Modern Typewriter

and my Python script contains the following lines

params = {‘backend’: ‘ps’,
'axes.labelsize
': 12,
‘text.fontsize’: 12,
‘xtick.labelsize’: 10,
‘ytick.labelsize’: 10,
‘text.usetex’: True,
‘figure.figsize’: fig_size}

rcParams.update(params)

I run what I believe is a standard openSUSE 10.2 installation of tetex and python, including matplotlib.

Still, fonts in my matplotlib plot are different from the ones used in my LaTeX document. Also, strangely
psfrag does not seem to work? Nothing ever gets replaced in my plot!

Can someone please help me out, what am I doing wrong?

Best regards,
Johan

Please make sure that the external dependencies are installed and properly
configured, see http://www.scipy.org/Cookbook/Matplotlib/UsingTex. If that
doesn't help, try setting your verbose.level to "debug", write as simple a
script as possible that reproduces the problem, and post again, along with
the output and perhaps the figure.

···

On Tuesday 07 August 2007 07:37:04 am Johan Ekh wrote:

Hi all,
I'm new to Python in general and Matplotlib in particular.
I'm trying to create publication quality plots for inclusion
in LaTeX papers and presentations and have some problems
to get the fonts right.

My matplotlibrc contains the following lines

font.family : serif
font.serif : Times, Palatino, New Century Schoolbook, Bookman,
Computer Modern Roman
font.sans-serif : Helvetica, Avant Garde, Computer Modern Sans serif
font.cursive : Zapf Chancery
font.monospace : Courier, Computer Modern Typewriter

and my Python script contains the following lines

params = {'backend': 'ps',
          'axes.labelsize': 12,
          'text.fontsize': 12,
          'xtick.labelsize': 10,
          'ytick.labelsize': 10,
          'text.usetex': True,
          'figure.figsize': fig_size}
rcParams.update(params)

I run what I believe is a standard openSUSE 10.2 installation of tetex and
python, including matplotlib.

Still, fonts in my matplotlib plot are different from the ones used in my
LaTeX document. Also, strangely
psfrag does not seem to work? Nothing ever gets replaced in my plot!

Can someone please help me out, what am I doing wrong?

This is admittedly a stupid question, but just to be sure, I don't see

usetex: True

in your post.

Ryan

···

On 8/7/07, Johan Ekh <ekh.johan@...287...> wrote:

Hi all,
I'm new to Python in general and Matplotlib in particular.
I'm trying to create publication quality plots for inclusion
in LaTeX papers and presentations and have some problems
to get the fonts right.

My matplotlibrc contains the following lines

font.family : serif
font.serif : Times, Palatino, New Century Schoolbook, Bookman,
Computer Modern Roman
font.sans-serif : Helvetica, Avant Garde, Computer Modern Sans serif
font.cursive : Zapf Chancery
font.monospace : Courier, Computer Modern Typewriter

and my Python script contains the following lines

params = {'backend': 'ps',
          'axes.labelsize ': 12,
          'text.fontsize': 12,
          'xtick.labelsize': 10,
          'ytick.labelsize': 10,
          'text.usetex': True,
          'figure.figsize': fig_size}
rcParams.update(params)

I run what I believe is a standard openSUSE 10.2 installation of tetex and
python, including matplotlib.

Still, fonts in my matplotlib plot are different from the ones used in my
LaTeX document. Also, strangely
psfrag does not seem to work? Nothing ever gets replaced in my plot!

Can someone please help me out, what am I doing wrong?

Best regards,
Johan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Hi, and thanks for your answer.

I got the following output from running my script with the --verbose-helpful flag:

— x —

joeh@…1695…:~/ABB/HVC/SubSea/Python> python plot_data.py --verbose-helpful
matplotlib data path /usr/lib64/python2.5/site-packages/matplotlib/mpl-data

$HOME=/home/joeh
CONFIGDIR=/home/joeh/.matplotlib
loaded rc file /home/joeh/.matplotlib/matplotlibrc
matplotlib version 0.90.0
verbose.level helpful
interactive is False
platform is linux2
numerix numpy 1.0.3
font search path [‘/usr/lib64/python2.5/site-packages/matplotlib/mpl-data’]
loaded ttfcache file /home/joeh/.matplotlib/ttffont.cache
backend GTKAgg version 2.10.3
Could not match Computer Modern Roman, normal, normal. Returning /usr/lib64/python2.5/site-packages/matplotlib/mpl-data/Vera.ttf

Found dvipng version 1.5
Could not match Computer Modern Roman, normal, normal. Returning /usr/lib64/python2.5/site-packages/matplotlib/mpl-data/Vera.ttf
Could not match Computer Modern Roman, normal, normal. Returning /usr/lib64/python2.5/site-packages/matplotlib/mpl-data/Vera.ttf

%%BoundingBox: 96 263 483 504
%%HiResBoundingBox: 96.933583 263.234875 482.480001 503.829758

— x —

Definitely looks like some missing fonts, does anyone known what I have to do?
Best regards,

Johan

2007/8/7, Darren Dale <dd55@…163…>:

···

On Tuesday 07 August 2007 07:37:04 am Johan Ekh wrote:

Hi all,
I’m new to Python in general and Matplotlib in particular.
I’m trying to create publication quality plots for inclusion
in LaTeX papers and presentations and have some problems

to get the fonts right.

My matplotlibrc contains the following lines

font.family : serif
font.serif : Times, Palatino, New Century Schoolbook, Bookman,
Computer Modern Roman

font.sans-serif : Helvetica, Avant Garde, Computer Modern Sans serif
font.cursive : Zapf Chancery
font.monospace : Courier, Computer Modern Typewriter

and my Python script contains the following lines

params = {‘backend’: ‘ps’,
‘axes.labelsize’: 12,
‘text.fontsize’: 12,
‘xtick.labelsize’: 10,

ytick.labelsize’: 10,
‘text.usetex’: True,
‘figure.figsize’: fig_size}
rcParams.update(params)

I run what I believe is a standard openSUSE 10.2
installation of tetex and
python, including matplotlib.

Still, fonts in my matplotlib plot are different from the ones used in my
LaTeX document. Also, strangely
psfrag does not seem to work? Nothing ever gets replaced in my plot!

Can someone please help me out, what am I doing wrong?

Please make sure that the external dependencies are installed and properly
configured, see
http://www.scipy.org/Cookbook/Matplotlib/UsingTex
. If that
doesn’t help, try setting your verbose.level to “debug”, write as simple a
script as possible that reproduces the problem, and post again, along with

the output and perhaps the figure.