[R-SIG-Mac] tiff output on Mac

David Winsemius dwinsemius at comcast.net
Thu Oct 15 23:36:20 CEST 2009


If you look at:

?png    # you will see several other options

I will say that the advice on that page to use capabilities() to  
determine which of these options is supported seems to be at least  
misleading in that tiff comes back FALSE but the tiff device accepts  
input without complaint and produces output that Preview.app reads.

 > sessionInfo()
R version 2.9.2 (2009-08-24)
x86_64-apple-darwin9.8.0

locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
 > capabilities()
     jpeg      png     tiff    tcltk      X11     aqua http/ftp   
sockets   libxml     fifo   cledit    iconv      NLS  profmem    cairo
     TRUE     TRUE    FALSE     TRUE     TRUE     TRUE     TRUE      
TRUE     TRUE     TRUE     TRUE     TRUE     TRUE    FALSE     TRUE

 > tiff('Mactest.tiff', width = 5, height = 5, units = 'in', res = 600)
 > plot(rpois(1:100,1))
 > dev.off()
null device
           1
# no errors, no problems viewing


Another option, ...  handle the translation to a tiff file by using  
Preview of hte saved pdf and then the Grab.app, or just Grab the  
quartz window. That method lets me minimize the white space in the  
margins. Tiff is the saved format from Grab.
-- 
David.

On Oct 15, 2009, at 1:08 PM, Michael Denslow wrote:

> Dear R Mac folks,
>
> I have not seen a thread on this so I thought I would get some input
> regarding tiff output on a Mac.
> I am currently running OS 10.6.1 and R 2.9.2 GUI 1.29 Tiger build 32- 
> bit (5464).
>
> I realize that the easiest way to save a plot is to select File, Save
> As. Which outputs a .pdf file. However, if I insert this graphic into
> Microsoft Word and send it to a friend on Windows the file gets
> mangled (the quality is decreased significantly). So I am working on
> just writing high quality tiff files which seem to display well all on
> both platforms. Tiffs also seems to be one of the preferred file types
> for many journals in my field.
>
> Here are the options I have found that work on Macs.
>
>
> # requires Ghostscript
> bitmap(file="MacTest.tiff", type = "tifflzw",
> 	height = 7, width = 7, res = 600,
>      units = "in")
> plot(rpois(1:40,10))
> dev.off()
>
>
> tiff('Mactest.tiff', width = 5, height = 5, units = 'in', res = 600)
> plot(rpois(1:100,1))
> dev.off()
>
> quartz(height = 7, width = 7, type = 'tiff', file = 'MacTest.tiff',bg
> = 'white',dpi = 600)
> hist(rpois(1:100,1))
> dev.off()
>
>
> hist(rpois(1:100,1))
> # line are not all dark in output, not sure which tiff type to use...
> dev2bitmap(file = 'MacTest.tiff', type = 'tiff24nc', height = 7, width
> = 7, res = 600,
> 	units = 'in')
>
>
> I have noticed that for bitmap and tiff the font and symbol size seems
> to differ between the R session plot and the output plot.
> Are there other graphic output options that I am missing here? Any
> tips would be most appreciated.
> Thanks in advance,
> Michael
>
> -- 
> Michael Denslow
>
> Graduate Student
> I.W. Carpenter Jr. Herbarium [BOON]
> Department of Biology
> Appalachian State University
> Boone, North Carolina U.S.A.
>
> -- AND --
>
> Communications Manager
> Southeast Regional Network of Expertise and Collections
> sernec.org
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-SIG-Mac mailing list