tags:

views:

135

answers:

3

A Journal we are sending an article to is asking for the following:

To ensure the best reproduction quality of your figures we would appreciate high resolution files. All figures should preferably be in TIFF or EPS format... and should have the following resolution: Graph: 800 - 1200 DPI Photo: 400 - 800 DPI Color (only CMYK): 300 - 400 DPI (DPI = dots per inch)

Since I am sending a graph, I am trying to save it using tiff.

Here is the code I am using:

tiff(filename = "c:\\aaa.tiff", 
     res = 800, pointsize = 2)
plot(1:100)
dev.off()    

But sadly, it produces a very "bulky" image (and if I where to not use pointsize = 2, I would get the error massage:

Error in plot.new() : figure margins too large

)

Any suggestions?

A: 

When you increase resolution (res), the effective size of a plot decreases, and so the margin error jumps out. Try to make bigger picture with greater width and height (in theory, to make a plot of a same virtual size, it should be new_(width|height)=res/72*old_(width|height).
Still, as romunov suggested, it is a better idea to use ImageMagick; you won't loose quality.

mbq
+4  A: 

short answer:

It's a bulky file because the higher the resolution raster file (TIFF) then the larger the file.

The other option, EPS, is like PDF or PS. Just save in any of those. That's a vector image format and one they said was acceptable. It will be more compact and of higher quality (unless your figure contains an enormous number of points or lines.)

long answer:

One format they asked for is TIFF, a raster format. It saves the information as a value representing each pixel in the image. If the image is 100 DPI and 5" square then that's 500x500 and it saves 250000 pixels of information. As the resolution of the resolution of the image gets larger then the points of information needed goes up. At 200 DPI it's 1000x1000 and 1e6 pixels of information. This explains why your file is so bulky.

In order to have a quality printed image at 5" square you would need about 300-400 DPI (dots per inch). That way you won't see each of those individual little pixels that make up the image. If it's at a lower resolution then the image is still 5" x 5" but each individual square block (pixel) that makes up the image is so large you can see them. That's why they asked for that resolution. Otherwise, text and lines in your graphs would appear blocky, jaggy, or blurry. It's why text on your computer screen (only around 100 DPI these days) isn't nearly as high quality as printed on a piece of paper (usually at least 300 dpi).

The other format they asked for was EPS. This is encapsulated postscript. Since it's a single page file PS, or postscript, would be equivalent. And, PDF is also similar. These are all vector formats, essentially the same vector format (they can contain raster format images too but let's ignore that).

A vector format file saves the information about how the image was drawn but not about each pixel. If you have an x-axis 3" long placed 0.5" from the bottom of the image then the vector file knows this. Because of this, for simple drawings it is vastly more compact than any raster representation at a given image quality. Furthermore, it scales in size without losing quality. You simply ask it to draw the image at 6" x 6" instead of 5" x 5" and it scales each of the instructions for drawing the components of the image up as well. Therefore, even though the PDF or EPS file will be more compact it will print at the highest quality.

Send a PDF or PS file and don't worry about the resolution.

John
It is not true that publishers that want EPS will also accept PDFs; conversion may be sometimes tricky.
mbq
i've seen this exact same request a dozen times or more and never had it fail. Nevertheless, eps() will work just fine.
John
For me it once failed; so it depends on technical editor preference I guess.
mbq
+3  A: 

One thing you should do is use the compression parameter.

For instance:

tiff("outfile.tif", compression = "lzw")

LZW is a lossless compression format, so you will not lose any data, but you will definitely reduce filesize.

nico