1

In my research work, when papers are to be communicated, the format could be either LaTeX or DOC/DOCX. This sends me into a dilemma.

I have generated PDFs (they can be easily included into a latex file) for certain plots using the base plot method. However, I would also like to have the PNG versions of the same plots (since MS Word does not accepts PDFs), and no, I do not want to rewrite codes! Further, the convert utility of ImageMagick is also not a preferable option, as there is a severe degradation in terms of resolution when one executes convert myFile.pdf myFile.png

What is the best way? Can we save a plot into a variable and then regenerate the plot to a png / jpg / tiff file?

Indian
  • 739
  • 1
  • 10
  • 21
  • 1
    Maybe this question: http://stackoverflow.com/questions/26232103/save-a-plot-as-png-and-pdf-only-by-one-call-to-the-plot-function-in-r/26233113#26233113 can help you. It says how to produce both pdf and png files out of an R plot. – nicola Jan 03 '15 at 12:25
  • Actually, MacOS version of MS Word does work with PDFs. – Marat Talipov Jan 03 '15 at 16:14

1 Answers1

0

Save to EPS format (see HowTo here). It is a vector format, and it should be recognizable by MS Word (you will need to import it as a picture) as well as LaTeX.

Community
  • 1
  • 1
Marat Talipov
  • 12,044
  • 4
  • 32
  • 50