I am having problems displaying histograms exported as .eps in Word 2010. I don't have problems though displaying them in a specialized .eps viewer. (Postsript viewer from Rampant logic) I am writing histograms because there were no problems in exporting or displaying any other plot type.

plot = Histogram[RandomVariate[NormalDistribution[0, 1], 200]]
Export["plot.eps", plot]

Mathematica graphics

Could it be that .eps files for histograms are corrupted? I did not find a way to attach the .eps file, so I hope that I am not the only person with this problem, although this is kind of wicked.

  • 2
    $\begingroup$ Try printing your Word document on a PostScript printer (or a virtual printer that outputs PDF) and see if it displays fine that way. Word does not support displaying EPS on screen. It does give a rough approximation sometimes, but this is just an approximation, not the final appearance. $\endgroup$
    – Szabolcs
    Feb 26 '13 at 17:57
  • 2
    $\begingroup$ This seems to be more of a Word problem than anything to do with Mathematica. The usual format to use if you want to include figures in a Word document is EMF, not EPS. $\endgroup$ Feb 26 '13 at 17:57
  • $\begingroup$ Reference for my previous comment: office.microsoft.com/en-us/word-help/… EDIT This is for Word 2003, not sure if 2010 is different in this repsect $\endgroup$
    – Szabolcs
    Feb 26 '13 at 17:58
  • 1
    $\begingroup$ Thanks for your swift comments. I tried both printing to pdf and printing to paper and in both cases it only shows "This image cannot currently be displayed", the same message as in word,perhaps some standard error image. I want to use EPS because the quality of the plots is much better. EMF shows compression artifacts. Also I posted the question here as I thought it might be a bug in Mathematica which messes up only the histogram EPS code, but not the EPS code of any other plot. $\endgroup$
    – malumno
    Feb 26 '13 at 18:07
  • 1
    $\begingroup$ Hm, you are right. There also seems to be an issue, particular to the histogram, with EMF output: EMF is a vector format, just like EPS, yet this plot is being rasterized for export (hence the artifacts you see--they are not characteristic of the EMF format in general). I wonder what it is about histograms that causes difficulties with vector output formats. $\endgroup$ Feb 26 '13 at 18:48

This is not a complete solution to your problem, since I face the same issue (see also here). You can improve the screen display of EPS in Word by using the ImageResolution option, like this:

Export["epstestg.eps", epstest, {"Graphics"}, ImageResolution -> 300]

A word of warning that this feature expects actual Graphics. If you are actually wanting to export a Grid of graphics and other things as a single graphic (which my application requires), you will need to do something like this to get the thing to be exported:

epstest = 
 With[{mygraph = 
    mySpecialBarChartFunction[fakedata, ChartLayout -> "Stacked"]},
  With[{dims = ImageDimensions[Rasterize[mygraph]]}, 
   Graphics[Inset[mygraph], ImageSize -> First[dims ], 
    AspectRatio -> (dims[[2]]/dims[[1]]), 
    BaseStyle -> {FontFamily -> "Arial", FontSize -> 16}] ]]

There is always a "But..."

In my tests, this results in acceptable results on-screen. It also prints nicely.


When you then try to save the resulting Word document as a PDF, the EPS graphics show as black rectangles.

If I work out a workaround to this, I will revise this answer.


I have found a very good method. Right click on the image in mathematica as usual and save the image as .eps.

Open this .eps file in Adobe Illustrator.

  1. Press Ctrl + A to select all the elements of the image.
  2. Press Ctrl + C to copy all the selected elements.

Open word paste the image by pressing Ctrl + V. Save as pdf in the usual way. You will get a non-spoiled image.


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.