Latex characters don't show when I save to eps

Hi,
I have a strange problem with matplotlib: I use the greek character phi as a
label ($\phi$). When I display the diagram everything looks fine, only when
I save to an eps file, the phi dissappears (emplty space instead). Some
other characters (\mu, \Delta) don't have this problem. Does anyone have an
idea what the problem could be?
Cheers,
Diaboflo

···

--
View this message in context: http://www.nabble.com/Latex-characters-don't-show-when-I-save-to-eps-tp25433829p25433829.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I can't reproduce this here, but your settings may be different than mine. What rcParams have you specified in your matplotlibrc (in particular, is usetex on or off)? What version of matplotlib?

Mike

Diaboflo wrote:

···

Hi,
I have a strange problem with matplotlib: I use the greek character phi as a
label (\\phi). When I display the diagram everything looks fine, only when
I save to an eps file, the phi dissappears (emplty space instead). Some
other characters (\mu, \Delta) don't have this problem. Does anyone have an
idea what the problem could be?
Cheers,
Diaboflo
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

The simplest case would be:

import pylab
pylab.plot([1,2])
pylab.xlabel("$\phi$")
pylab.savefig("fig.png")
pylab.savefig("fig.eps")

The png has the xlabel as phi, the xlabel in the eps file is just empty.

I use python 2.5, don't really know which version of matplotlib is installed
but it is not older than a year.

Here the latex part of matplotlibrc:

### LaTeX customizations. See
http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
#text.usetex : False # use latex for all text handling. The
following fonts
...
#text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for
handling
...
#text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX
FAILURES
...
#text.dvipnghack : False # some versions of dvipng don't handle
...
#text.markup : 'plain' # Affects how text, such as titles and
labels, are

Thanks for your answers so far.

Diaboflo

···

--
View this message in context: http://www.nabble.com/Latex-characters-don't-show-when-I-save-to-eps-tp25433829p25474537.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

The simplest case would be:

import pylab
pylab.plot([1,2])
pylab.xlabel("\\phi")

Does this help:
pylab.xlabel(r"\\phi")

···

On Wed, Sep 16, 2009 at 11:13 AM, Diaboflo <fh22@...2784...> wrote:

pylab.savefig("fig.png")
pylab.savefig("fig.eps")

The png has the xlabel as phi, the xlabel in the eps file is just empty.

I use python 2.5, don't really know which version of matplotlib is installed
but it is not older than a year.

Here the latex part of matplotlibrc:

### LaTeX customizations. See
http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
#text.usetex : False # use latex for all text handling. The
following fonts
...
#text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for
handling
...
#text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX
FAILURES
...
#text.dvipnghack : False # some versions of dvipng don't handle
...
#text.markup : 'plain' # Affects how text, such as titles and
labels, are

Thanks for your answers so far.

Hi,
no, this gives the same result: Fine with \\Delta but not with \\phi :frowning:
Flo

Darren Dale-3 wrote:

···

Does this help:
pylab.xlabel(r"\\phi")

--
View this message in context: http://www.nabble.com/Latex-characters-don't-show-when-I-save-to-eps-tp25433829p25475329.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Can you send the output of

>>> import matplotlib
>>> matplotlib.__version__

It's possible this is a bug that has already been fixed in the development version, but I'd like to confirm that by running the same version that you have.

Mike

Diaboflo wrote:

···

The simplest case would be:

import pylab
pylab.plot([1,2])
pylab.xlabel("\\phi")
pylab.savefig("fig.png")
pylab.savefig("fig.eps")

The png has the xlabel as phi, the xlabel in the eps file is just empty.

I use python 2.5, don't really know which version of matplotlib is installed
but it is not older than a year.

Here the latex part of matplotlibrc:

### LaTeX customizations. See
http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
#text.usetex : False # use latex for all text handling. The
following fonts
...
#text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for
handling
...
#text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX
FAILURES
...
#text.dvipnghack : False # some versions of dvipng don't handle
...
#text.markup : 'plain' # Affects how text, such as titles and
labels, are

Thanks for your answers so far.

Diaboflo

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Michael Droettboom-3 wrote:

Can you send the output of

>>> import matplotlib
>>> matplotlib.__version__

It's possible this is a bug that has already been fixed in the
development version, but I'd like to confirm that by running the same
version that you have.

Mike

Here you go:

import matplotlib
matplotlib.__version__

'0.91.2'

Flo

···

--
View this message in context: http://www.nabble.com/Latex-characters-don't-show-when-I-save-to-eps-tp25433829p25475534.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Hmm... 0.91.2 works for me. What platform are you on?

When you view the attached file, do you see the "phi" in the title area? That can rule out a problem in your viewer.

If that works for you, can you send me the .eps file you generated?

Mike

Diaboflo wrote:

test.eps (12 KB)

···

Michael Droettboom-3 wrote:
  

Can you send the output of

>>> import matplotlib
>>> matplotlib.__version__

It's possible this is a bug that has already been fixed in the development version, but I'd like to confirm that by running the same version that you have.

Mike

Here you go:

import matplotlib
matplotlib.__version__
        

'0.91.2'
  
Flo
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi all,
I got my administrator to update the python modules (matplotlib, scipy,
numpy) and now it works fine. Seems to be an already fixed bug.
Thanks to all for your help!
Flo

···

--
View this message in context: http://www.nabble.com/Latex-characters-don't-show-when-I-save-to-eps-tp25433829p25487259.html
Sent from the matplotlib - users mailing list archive at Nabble.com.