Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to export a plot into an eps file. Below I present a sample plot code in order to demonstrate the two issues that appear.

(1). LabelStyle: When I use "Times" or "Helvetica" style all seem to work fine. However, when I choose "Traditional" or "Tahoma" the style of the labels in the exported eps file is horribly deformed. This happens regardless the procedure I use; using the Export command or choosing the plot and then form File -> Save Selection As ...

(2). Capital Greek letters: I use the capital Greek letter Theta for the label of the y-axis. However, I discovered that many capital Greek letters are also deformed in the exported eps or pdf file.

Many thanks in advance and I look forward for your replies and comments

S1 = Plot[Exp[-x]*Sin[7*x], {x, 0, 5}, Axes -> False, Frame -> True, 
 FrameLabel -> {"x", "Θ(x)"}, RotateLabel -> False, PlotStyle -> Red, 
 LabelStyle -> Directive[FontSize -> 17, FontFamily -> "Helvetica"], 
 PlotRange -> All, ImageSize -> 500] 

Export["Plot.eps", S1]

Thank you very much for all your replies and I am really very sorry for not responding sooner. I am using the latest version 9.0 of Mathematica in Windows XP SP3. However, the same issues appear in older versions (8,7, ... , 4) which are also installed in my PC. Therefore, I suppose that the version is irrelevant. Below I present three exports using different format (eps, pdf and jpg). I used "Tahoma" style.

First the .jpg output. All seems to be OK.

enter image description here

Then the .pdf output. Well, the Greek capital letter Theta is deformed.

enter image description here

And finally, the .eps output loaded in GSView 5.0. Here, not only the Greek letter but also the axis labels are deformed. However, if I convert the exported .eps file to .pdf with Adobe the axis labels are becoming normal as Fig. 2 but still the Greek letter is deformed.

enter image description here

If I am correct, I encounter an issue regarding fonts. So, I would be very grateful if you could suggest me some solutions to my problem.

share|improve this question
    
Vaggeli, have you tried the trick described here? pages.uoregon.edu/noeckel/MathematicaGraphics.html#OutlineFonts –  gpap Dec 18 '12 at 11:59
    
Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! –  ssch Dec 18 '12 at 12:16
    
Καλωσόρισες στιν Mathematica.SE Βαγγέλη! Since you have a Greek-sounding name, I have to ask: are you using a Greek version of Windows (or whatever your OS is)? Or did you change the regional settings to Greek? I know that the Mathematica Front End has a different handling of Greek letters on Greek systems, see e.g. here. –  Szabolcs Dec 18 '12 at 18:52
    
possible duplicate of Trouble with fonts when exporting a 2D-plot to vector formats –  Jens Dec 18 '12 at 19:12
    
It seems people can't reproduce the problem, and there are a number of close votes on your question. It's important to reply to the comments so we can figure out what exactly is going on. Please post your operating system, regional settings (greek or not), and a screenshot example of what the output looks like. –  Szabolcs Dec 20 '12 at 20:28

2 Answers 2

Your plot, exported to EPS, looks OK on my system (Mathematica 9, Mac OS X):

The version using Helvetica:

Helvetica

A version using Georgia:

Georgia

(I used Georgia because it's easier to spot with those lower-case numerals.)

The Θ (theta) in both cases is identical - probably the Mathematica2 font.

In your EPS example, the main font has been replaced with what looks like Courier - which is the time-honoured way for font handling to fail in a PostScript-based workflow. (A google search for this issue should show millions of results going back to the 20th century.)

However, the EPS file which Mathematica generated for me contains the fonts embedded within it, and so there's no obvious reason why a PostScript renderer should fail to use them. If your EPS files also contain the needed font resources, which a quick glance with a text editor could confirm, then your problems may be more to do with your system, and the installation of gsview and GhostScript (if it's still called that) than with Mathematica.

share|improve this answer
    
By the way, an unrelated question: in the first export you attach, on the left hand side, there's a tiny little sliver of Θ missing. It doesn't get fixed by changing the PlotRangePadding. Do you know if/how it's fixable? –  gpap Dec 18 '12 at 21:09
    
@gpap For me, this is only a visible artefact on the PNG I posted here. The original EPS, and the PDF I converted it to on the way, have a pixel or two of white-space at the left of the character. It's still pretty tight, though... :) –  cormullion Dec 18 '12 at 22:16

There was another issue in the comment to @cormullion's answer, related to a missing sliver of the exported graphic on the side. If you see that kind of problem, it can help to set the PlotRegion to be slightly less than 100% of the available width or height determined by ImageSize.

To show this, I'll use the answer linked here and modify your plot by appending two options at the end:

S1 = Plot[Exp[-x]*Sin[7*x], {x, 0, 5}, Axes -> False, Frame -> True, 
  FrameLabel -> {"x", "\[CapitalTheta](x)"}, RotateLabel -> False, 
  PlotStyle -> Red, 
  LabelStyle -> Directive[FontSize -> 17, FontFamily -> "Helvetica"], 
  PlotRange -> All, ImageSize -> 500,
  PlotRegion -> {{0.04, 0.96}, {0.04, 0.96}},
  FrameStyle -> Thickness[.002]]

outlinedExport[name_, gr_, opts : OptionsPattern[]] := 
 Export[name, 
  First@ImportString[ExportString[gr, "PDF"], "PDF", 
    "TextOutlines" -> True], FilterRules[{opts}, Options[Export]]]

outlinedExport["plot.eps", S1]

(* ==> "plot.eps" *)

Now the result of Import["plot.eps"] will look like this:

with margins

where I highlighted the image border to show the extra margins around the frame.

share|improve this answer
    
Thanks a lot - I have had this problem but had learnt to live with it. Does this mean that if you export an image of width X cm and font size Y you need to amend the width (i.e. slightly more than X cm) in LaTeX for the fonts to look the right size? +1 btw, when I had the same font problem, the instructions on your blog were life-saving. –  gpap Dec 19 '12 at 10:05
    
@gpap Thanks - yes, unfortunately the font size is known as an absolute number only as long as you're in Mathematica. As soon as you export, it will scale rigidly with the size of the image, and I don't think there's any way to get around that with a PDF or EPS graphic. And that's true no matter if you outline the fonts or not. –  Jens Dec 19 '12 at 16:25
    
I noticed @Vaggelis_Z still seems to have issues, but he never gave any feedback for this answer (or any of them). –  Jens Dec 21 '12 at 22:54
1  
@Jens I uploaded three new outputs. It seems that the problem appears only when I want to export the plot as eps or pdf. When choosing .png or jpeg everything is OK. Any ideas? How exactly does Mathematica exports and create an .eps file? I have ghostscript installed. Is it related? –  Vaggelis_Z Jan 2 '13 at 16:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.