1
$\begingroup$

I'm experiencing some strange problem, which is, when I try to export a figure to the eps form, either by right-click save as, or by the export command, the obtained .eps file seems in fact not to be in vector form, because when I open it in adobe illustrator, nothing can be edible, just acts as if it were a .jpg figure.

Also, in another plot generated by parametric plot, even though the eps figure is in vector form, the fonts can not display correctly in illustrator.

I have not encountered this problem with the previous versions of mathematica, I wonder how I can solve this?

below is a example that I have used for the two figures. Any suggestions will be appreciated!

Example:

    ra = {-1, 1}
    sSphere = ParametricPlot3D[{Cos[\[Phi]] Sin[\[Theta]], 
    Sin[\[Phi]] Sin[\[Theta]], Cos[\[Theta]]}, {\[Phi], 0, 
    2 \[Pi]}, {\[Theta], 0, \[Pi]}, Boxed -> False, 
    AxesStyle -> Directive[Black, 12, Opacity[0.6]], 
   PlotStyle -> {Cyan, Opacity[0.15]}, Mesh -> Full, 
    ColorFunction -> "BlueGreenYellow", 
      MeshStyle -> Directive[Green, Opacity[0.03]], 
   Mesh -> {Range[-Pi, Pi, 0.04 Pi], Range[0, 2 Pi, 2 Pi], {}}, 
   PlotRange -> {ra, ra, ra}, ViewPoint -> {1.3, -2.4, 2.}, 
     AxesEdge -> {{-1, -1}, {1, -1}, {-1, -1}}] 

    LIcrosssection =  ParametricPlot[{Cos[gamma],  Sin[gamma]}, {gamma, -Pi/2, Pi/2},  
   AxesOrigin -> {0, 0}, PlotStyle -> {Directive[Red], Directive[Red]},   PlotRange -> {ra, ra}]

P.S. The options I used, and the behavior of the figure in illustrator are as shown in the figures enter image description here enter image description here

$\endgroup$
  • $\begingroup$ I'm afraid that, generally speaking, v.10 will force rasterization of vector graphics upon export. See: Export Plot3D in Mathematica 10.1 is Rasterized by default and Exporting 2D & 3D graphics for use in Adobe Illustrator, and pehaps others that you can find by searching this site for "3D export" or similar. $\endgroup$ – MarcoB Jun 7 '16 at 20:30
  • $\begingroup$ Thanks Marco, I have read your recommendations, but seems they are exporting to pdf format, while I need a eps figure which I will use in latex with psfrag. actually I do not quite care about the figure itself, I mostly would like to have the axis and labels to be in vector form, so that I can select them or do some edits on them. In this case, do you have any suggstions? $\endgroup$ – larry Jun 7 '16 at 20:53
  • $\begingroup$ Larry, the format to export to doesn't make much difference (i.e. PDF and EPS would work the same here). This is, however, a long standing problem. For your axes, you might be interested in the following too: Rasterized image together with vector-graphics axes, and this older post on StackOverflow: Mathematica: Rasters in 3D graphics. $\endgroup$ – MarcoB Jun 7 '16 at 23:20
2
$\begingroup$

Your 3D plot contains semi-transparent objects what isn't supported by the EPS format but is supported by PDF. For your plot the workaround suggested by Jens works quite well with Mathematica 10.4.1 on Windows:

Export["myFig.pdf", 
 Graphics[Inset[sSphere, Automatic, Automatic, Scaled[1]]]];

The above generates a high-quality vector PDF file of size 21.7 Mb. Here is how it looks when opened in Adobe Acrobat (I have selected a number on the axis in order to prove that it is text, not raster):

screenshot

If you really need EPS, you should flatten the transparency and convert to EPS using one of the methods described in the linked answer of mine.

$\endgroup$
  • $\begingroup$ Thanks Alexey, I now understand why it happens and seems this can not be avoided if I need to use the semi-transparency option. But I just remember that I ever found a trick, which is to plot this figure without the axes, and plot a figure with only the axis. After that, one can combine these two figures somehow in mathematica, but somehow I didn't manage to do it in mathematica to get the edible eps file, so I combined the two figures in adobe illustrator and aligned them manually. Hope this helps to those who come to this post. $\endgroup$ – larry Jun 8 '16 at 1:32
  • $\begingroup$ @larry I'd like to encourage you to add your trick as an answer to this question as well. Self answers are encouraged in SE, and your trick might be useful to others down the line that experience the same problem. $\endgroup$ – MarcoB Jun 8 '16 at 4:22
0
$\begingroup$

After summarizing the answers, it seems that this phenomenon can not be avoided if one need to use the semi-transparency option. One can try to export them as pdf as suggested by MarcoB and Alexey.

And I just notice an alternative way that might be used here, which I used to shrink the size of the eps file. So I'm including it here in case it may help.

The idea is to plot this figure without the axes, and plot another figure with only the axis. After that, one can combine these two figures in mathematica and create a eps file whose axes and labels are vector form, but somehow I didn't manage to do it in mathematica to get the edible eps file, so I combined the two figures in adobe illustrator and aligned them manually (In this case, I plotted the axes in the first figure as well, but thinner, which will be covered by the axes in the second figure). It is not elegant but works. Hope this helps to those who come to this post.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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