In R
, I use par
to prepare four boxplots (using boxplot
) as a single image, which I save with the png()
command. This image is included in a LaTeX document with \includegraphics
. I have experimented with exporting different image sizes, and changing the scaling in LaTeX, but the image quality is still poor. I don't really have time to learn Sweave
or knitr
right now. What settings should I use to optimize the image quality?
2
5
Saving the image from R as a PDF rather than a PNG file solved this:
In R:
pdf('theFile.pdf')
# par...
# plot...
dev.off()
In LaTeX:
\includegraphics[scale=0.8]{theFile.pdf}
I did not specify image dimensions in R. The image quality in the final PDF was excellent, even though I scaled it to 80%.
R
'spng()
command, so you are asking in the wrong place. Btw, canR
output vector graphics like eps or pdf? Then you should use those. – mafp Feb 14 '13 at 9:14\includegraphics
may result in lower quality images? Any scaling should be done outside of LaTeX. Hence my question about how to optimize the quality of an R image in LaTeX. I would have preferred that the question be moved to another site, rather than down-voted. – SabreWolfy Feb 14 '13 at 9:39