Tal Galili
2010-Aug-29 16:46 UTC
[R] Saving plot to tiff, with high resolution for publication ?
Hello all. 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 ) I am clearly missing something basic here about the use of DPI, I would appreciate any help in figuring this out. Thanks! Tal ----------------Contact Details:------------------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- [[alternative HTML version deleted]]
Joshua Wiley
2010-Aug-29 18:24 UTC
[R] Saving plot to tiff, with high resolution for publication ?
Hi Tal, You have set the resolution, but you have not set the width/height. The res argument generally controls how many pixels per inch (PPI which is often used similarly to DPI). So if you want 800 DPI and you want it to be a 4 x 4 inch graph something like: tiff(file = "temp.tiff", width = 3200, height = 3200, units = "px", res = 800) plot(1:10, 1:10) dev.off() This will make a file that is 3200 x 3200 pixels, with an 800 resolution gives you 3200/800 = 4 inches. I would also recommend choosing some sort of compression or you will end up with a rather large file. Cheers, Josh On Sun, Aug 29, 2010 at 9:46 AM, Tal Galili <tal.galili at gmail.com> wrote:> Hello all. > > 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 > > ) > > > I am clearly missing something basic here about the use of DPI, I would > appreciate any help in figuring this out. > > Thanks! > > > Tal > > ----------------Contact > Details:------------------------------------------------------- > Contact me: Tal.Galili at gmail.com | ?972-52-7275845 > Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | > www.r-statistics.com (English) > ---------------------------------------------------------------------------------------------- > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/
David Winsemius
2010-Aug-29 18:46 UTC
[R] Saving plot to tiff, with high resolution for publication ?
On Aug 29, 2010, at 12:46 PM, Tal Galili wrote:> Hello all. > > 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)?tiff (Merely from reading the help pages... not claiming to be an expert in graphics devices.) At the moment I suspect you are running into problems because the default units for the height and width of the tiff device is in pixels (="px") and the default size for each is 480. The width in pixels is less than 800 so you need to get your 800 into 480 by dividing by 2. Perhaps changing the units to "cm" or "in" and then the using materially smaller sizes for height and width you can get more satisfactory combinations of size and resolution. (Of course, this does not apply to EPS since it is not a raster image format. Either your publisher is confused on this point or you haven't faithfully transmitted their message.) -- David.> > 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 > > ) > > > I am clearly missing something basic here about the use of DPI, I > would > appreciate any help in figuring this out. > > Thanks! > > > Tal > > ----------------Contact > Details:------------------------------------------------------- > Contact me: Tal.Galili at gmail.com | 972-52-7275845 > Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il > (Hebrew) | > www.r-statistics.com (English) > ---------------------------------------------------------------------------------------------- > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD West Hartford, CT
Barry Rowlingson
2010-Aug-29 19:13 UTC
[R] Saving plot to tiff, with high resolution for publication ?
On Sun, Aug 29, 2010 at 5:46 PM, Tal Galili <tal.galili at gmail.com> wrote:> Hello all. > > 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.Firstly, EPS is a vector format so DPI doesn't make any sense (except for embedding raster image data within it). Secondly, how do you know many dots (pixels) to make your image if you don't know how big in inches your image is going to be? Thirdly, if its a graph, it's probably best saved as an EPS to preserve the inherent vector nature of a plot. Fourthly, I should have answered this on stackoverflow.org in order to increase my reputation points :) Or maybe decrease them :) Barry