4

I have seen this question before, but with no real solution. The problem is, I have a plot that uses greek characters (sigma to mark first and second standard deviations) and other symbols (e.g. Angstroms), but this information does not translate into the graphs.

This is a MWE, obviously messy since I just want to show that I'm not getting the characters and a lot of the options are remnants from the original plot.

Show[{Plot[Sin[x], {x, 0, 5}], 
  Graphics[Text[Style["+1σ", FontSize -> 14], {4, 0.4}]]}, 
  Frame -> True, FrameLabel -> {{"Å", None}, {"x", None}}, 
  FrameTicks -> Automatic,
  BaseStyle -> {FontSize -> 14, FontFamily -> "Helvetica"}]

(In the last line, I use "BaseStyle" because I saw on here as a potential solution, but it does nothing.)

Here is what the above code outputs in PNG:

enter image description here

As you can see, I need the sigma and the Angstrom symbols to appear. However, when exported to EPS, I get (converted)

enter image description here

The sigmas turn into "s," and the Angstrom symbol disappears.

What is the work-around for this? For reference, I am using Mathematica 9 on Mac OS X (10.6).

LCarvalho
  • 9,233
  • 4
  • 40
  • 96
Erika H
  • 113
  • 1
  • 6
  • 2
    I am displaying the exported eps without problems on two systems, one win8 pc on which Mathematica (10) is installed, and another (win7) where it isn't. Update: With V9 I do see problems. – Sjoerd C. de Vries Dec 04 '14 at 21:38
  • @SjoerdC.deVries, I am using Mathematica 9 on Mac OS X (10.6). – Erika H Dec 04 '14 at 21:44
  • I know, you said so above. It is sometimes useful to see whether a problem persists over system and version boundaries. This might provide an indication as to the source of the problem. In this case, indications are that (at least on windows) V10 solves a problem that exists on V9. – Sjoerd C. de Vries Dec 04 '14 at 21:47
  • I see no problem with both v.8.0.4 and 10.0.1 installed on Windows 7 x64. – Alexey Popkov Dec 05 '14 at 07:20
  • the problem is the fonts are not embedded and the result depends on whether whatever software you use for display has access to the mathematica fonts. For portability you should specify a universally available font such as Symbol. – george2079 Dec 05 '14 at 13:35

1 Answers1

2

following my comment try this:

 fig = Show[{Plot[Sin[x], {x, 0, 5}], Graphics[
        Text[Style["+1 s", FontSize -> 14, FontFamily -> "Symbol"], {4, 0.4}]]},
 Frame -> True, 
    FrameLabel -> {{Style[ FromCharacterCode[197] , FontSize -> 14, 
            FontFamily -> "Helvetica"] , None}, {"x", None}}, 
            FrameTicks -> Automatic, 
            BaseStyle -> {FontSize -> 14, FontFamily -> "Helvetica"}]
 Export["fig.eps", fig]

Notice I use a plain "s" which is the greek "sigma" character in the symbol font. The angstrom symbol isn't in the standard symbol font, so I used the one from the "Helvetica" font ( which in turn gets subbed for ArialMT if you are on one of Mr Gates evil systems. )

I notice by the way inspecting the file the eps still calls for the special mathematica fonts for the math operators ( the "+" and "-" in the labels ) even though we have explicitly specified the font using Style. (It ends up ok since those symbols are pretty much the same in whatever font that gets substituted)

I must say , when I need high quality / portability I punt and use 'tiff'

george2079
  • 38,913
  • 1
  • 43
  • 110
  • This seems to work so far, but I have one more question, which might be a dumb one: how can I mix text and symbol, so it reads "Line Width ([Angstrom])?" Thanks! – Erika H Dec 06 '14 at 20:10
  • I solved the above problem using StringJoin. Style[StringJoin["Wavelength (", FromCharacterCode[197], ")"],FontSize -> 14, FontFamily -> "Times"] – Erika H Dec 08 '14 at 21:26