I want to put my Plot output into an MS Word document without having to edit it in Corel first, so I want to export it ready for Word in vector format complete with legends, expressions, axes, and frames. Is it possible to do that in Mathematica 9? After getting Plot output, what procedure should I follow to put it into Word?

I want the best quality figures in my Word document with thin colored lines. Here is example of what I to do when I have many curves on one plot, using dashed and dotdashed combination.

  Plot[{Sin[x], Sin[2 x], Sin[3 x], Sin[4 x], 1/x}, {x, 0, 2 Pi}, 
    PlotLegends -> "Expressions"]

I look forward to seeing your examples of multi-curve plots that are Word export-ready.

  • $\begingroup$ Try exporting as SVG, Export[filename, plot, "SVG"] $\endgroup$
    – ssch
    Commented Jan 13, 2013 at 13:09
  • $\begingroup$ @ssch do you have answer with more details, figure should be ready and clear for word, similar with figures from origin or excel. $\endgroup$
    – Pipe
    Commented Jan 13, 2013 at 15:08
  • $\begingroup$ If you use Export["file.pdf", plot], doesn't inserting the PDF in Word work? (You can also select the output cell and use the menu command "Save Selection as...".) $\endgroup$
    – Michael E2
    Commented Jan 13, 2013 at 15:11
  • $\begingroup$ @ Michael I need full quality to put first in word doc to set positions of several figures and then export with text. More detail and professional answer is required. $\endgroup$
    – Pipe
    Commented Jan 13, 2013 at 15:16
  • 1
    $\begingroup$ A related question may be How can I ensure graphics exported in WMF format don't have text-spacing problems? $\endgroup$
    – Jens
    Commented Jan 13, 2013 at 18:34

2 Answers 2


The built-in Legend package is really bad. A good alternative is legendMaker and is fully documented here. Assuming you loaded this package, you can use this code, from your example:

plot = Plot[{Sin[x], Sin[2 x], Sin[3 x], Sin[4 x], 1/x}, {x, 0, 2 Pi},
   Frame -> True, FrameLabel -> (Style[#, 16] & /@ {"x", "f(x)"})]
labels = {Sin[x], Sin[2 x], Sin[3 x], Sin[4 x], Superscript[x, -1]};
opts = Sequence[Background -> LightOrange, RoundingRadius -> 10];
newPlot = 
 Overlay[{plot, legendMaker[labels, opts]}, Alignment -> {0.8, 0.9}]

The result is: enter image description here

Having plotted everything you need, saving as PDF is easy - just use


The result is vector graphics with full quality and is scalable. You can then include the PDF file in your Word document, or better yet, in $\LaTeX$.

  • $\begingroup$ something is wrong in the code? isn't it? I got something not very well. $\endgroup$
    – Pipe
    Commented Jan 13, 2013 at 16:12
  • $\begingroup$ thank you very much, but what I should do. First to run which code? Final in another post are f and g and when I want to apply mine, doesn't work? $\endgroup$
    – Pipe
    Commented Jan 13, 2013 at 16:24
  • $\begingroup$ How did you get last figure? $\endgroup$
    – Pipe
    Commented Jan 13, 2013 at 16:32
  • $\begingroup$ Glad to see that the legendMaker solution is still of use. Just when I was being asked to update it, version 9 came out with new Legends so I didn't improve it further. Another way to do it with the code in my answer is just one line: autoLegend[plot, {Sin[x],Sin[2 x],Sin[3 x],Sin[4 x],Superscript[x,-1]}, Alignment -> {.5, .6}] (the Alignment scales from -1 to 1 in both directions). I can'te really post another answer because I don't have that thing called "word". $\endgroup$
    – Jens
    Commented Jan 13, 2013 at 18:25
  • $\begingroup$ Word does not support importing vector graphics in PDF format. EMF should be used instead. $\endgroup$ Commented Jan 14, 2013 at 1:29

Until now I have been unable to import vector graphics into a distributable Word file. The first thing I do is decide on a specific style I use throughout a notebook, e.g.

opts = BaseStyle -> {20, FontFamily -> "Times", Italic};

Then I simply save the plots with code such as

image = Show[graph, ImageSize -> 1024]; Export[name, image, "JPEG"]

and insert the JPG-image into the Word file. You would have to make sure that the size of your PlotLegends etc. fit the image size. The results are usually more than reasonably good. However, I usually go through several rounds of adaptations until I am satisfied.

  • $\begingroup$ @Stelzer Thank you for your answer, can you share your experience with steps until the figure is ready for word and then further for pdf file? $\endgroup$
    – Pipe
    Commented Jan 13, 2013 at 15:02
  • $\begingroup$ Are you using origin, corel or excel for adaptations? $\endgroup$
    – Pipe
    Commented Jan 13, 2013 at 15:09
  • 4
    $\begingroup$ +1 But you should PNG not JPG. JPG is for photographs. (JPEG stands for joint photographic experts group). See this Wiki link for quality comparison: en.wikipedia.org/wiki/… $\endgroup$ Commented Jan 13, 2013 at 16:16
  • $\begingroup$ @ChrisDegnen I agree about PNG - but I recall ten years ago (the last time I used "word") there was also WMF which looked promising. If this still exists it may be closer to PDF... $\endgroup$
    – Jens
    Commented Jan 13, 2013 at 18:29
  • 3
    $\begingroup$ @Jens WMF is obsolete format. It is replaced by EMF which gives much better results especially when dealing with non-ASCII characters. The EMF export is supported by Mathematica. This format is the native vector graphics format of Microsoft Office. $\endgroup$ Commented Jan 14, 2013 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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