1

I am saving images to .eps using python and Matplotlib.

LaTeX is not reading the image labels correctly, in that the labels seem to be dropping characters. I suspect it has something to do with "math mode" and the labels. The label (in Python) is:

ylabel(r'$\varepsilon_{x}$ ($\mu$m)') 

The only things showing up are the elements that are in math mode (between the $ signs), but not the subscript {x}. So instead of a nice epsilon with a subscript followed by the units, I am getting an epsilon, and a mu, and nothing more.

I can't just include everything inside $ signs, as that would screw up the look of the m and the ( and )s, and that doesn't explain why {x} isn't working.

I can also save things as png, and convert them to eps, but that introduces a bunch of resolution issues and removes the ability to edit the labels inside the eps. Any other program designed to look at the .eps file directory displays it properly. It appears to be only LaTeX that is giving me issues.

Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44
user1919931
  • 11
  • 1
  • 2
  • If it only displays math-mode content, then you can use `$\varepsilon_{x}\ (\mu\textrm{m})$`. However, it's bizarre that it doesn't show the subscript. – Werner Dec 21 '12 at 00:37
  • Yeah, I can't understand the missing subscript either. It may have something to do with the { }, as another plot with ylabel(r'$B_\perp$ (A/m$^2$)') plots the perpendicular sign correctly. However, there are multiple other plots throughout the document that need subscripts of xi, yi, etc. that require they be enclosed with the { }. And, of course, all of these notations appear correctly throughout the body of the document. – user1919931 Dec 21 '12 at 15:57
  • It would be best to provide a complete minimal example that replicates the problem. Otherwise it's hard to tell where the source of the problem may be. – Werner Dec 21 '12 at 16:51

1 Answers1

0

Try saving the pictures in PDF format instead of EPS. Modern LaTeX is really pdfLaTeX, which doesn't support EPS inclusions.

It could be that your LaTeX distro is set up to try and convert EPS pictures to PDF on the fly using the \write18 mechanism. But that could fail if it doesn't find all the necessary fonts.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94
  • When I save as a PDF, LaTeX gives me an error about there not being a BoundingBox: ! LaTeX Error: Cannot determine size of graphic in image.pdf (no BoundingBox). Is this normal for PDF images in LaTeX? – user1919931 Dec 28 '12 at 19:25
  • No, certainly not. I have LaTeX documents with more than 50 PDF figures without problems. I downloaded some PDF demos from the matplotlib website, and I can determine the boundingbox without problems. – Roland Smith Dec 28 '12 at 23:02