I have a histogram with several hundred items, for which I do a Q-Q plot. This results in EPS that is 2.5 megabytes large. This is too much for a figure that is only going to be included in a publication and is not going to be viewed at 100x magnification.
Is there any option in R to somehow output smaller EPS? I have searched docs to no avail. Or is my best option to, say, rasterize it afterwards at 300 dpi? If that's the case, any recommendations for the tool for this job?
The R code for the plot is nothing fancy:
postscript(filename)
qqnorm(n, main=title))
qqline(n)
dev.off()
EDIT: Doh! My question mentioned outputting EPS, and then converting it to some raster format. When of course I could just generate PNG in the first place from R.
Preferred Method for Saving EPS Files For vectors containing transparencies, set the Raster/Vector Balance to 0 and the Resolution settings to 72 ppi in order to dramatically reduce your file size.
That said, there are a few things you can do, to make an EPS file smaller: convert all fonts to outlines and/or uncheck "Embed Fonts" in save dialog. simplify path detail ( Object >> Path >> Simplify ) Keep fancy bitmap effects (like shadows and transparency) to a minimum.
Resolution Files submitted for digital offset printing should be 400 DPI (dots-per-inch) at the actual size that they will be used. A 4.25 X 6.25 photoshop EPS file in CMYK mode should be 16.2 megabytes. Anything over 400 DPI will be discarded.
Go to the file selection area and change All Graphics Files to All Files. Word will convert the EPS file and then insert it into the Word file.
I've just tried several things that didn't work - I'm including them here to save others wasting their time. For reference, I set n <- rnorm(1e5)
in your code above.
Things that don't work:
Setting colormodel <- "gray"
.
Using a different value of pch. (Some other values increase the file size, but I found none that decrease it.)
Setting useKerning = FALSE
.
Changing the width and height settings.
Using pdf instead of postscript.
Using CarioPS from the Cairo package.
In the light of this, I think that you are unlikely to be able to decrease the file size using a vector format. This means that you will have to use a raster format (most likely PNG).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With