plotting - What is the best way to make a plot complete with legends so it is exported-ready for Word?
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.
Answer
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:
Having plotted everything you need, saving as PDF
is easy - just use
Export["foo.pdf",plot]
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$.
Comments
Post a Comment