[R] Saving plot to tiff, with high resolution for publication ?

Joshua Wiley jwiley.psych at gmail.com
Sun Aug 29 20:24:29 CEST 2010


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/



More information about the R-help mailing list