Gustaf Rydevik
2008-May-23 14:40 UTC
[R] Preparing high quality figures with tiff as end result
Hi all, I'm currently preparing some figures that will be submitted to PloS One. In their guidelines they state that they will only accept figures in tiff or eps format, with the warning that eps figures will be converted to tiff format ( see http://www.plosone.org/static/figureGuidelines.action ). Because of this conversion, I figured I'd generate tiff-format figures from the beginning. However, a number of issues cropped up: 1) using library(Cairo) CairoTIFF("test.tif") I get " Sorry, this Cairo was compiled without tiff support.". I tried finding out how to recompile Cairo, but got lost in a lot of confusing talk about GTK+, downloaded dll files that I didn't know how to use etc. so I turned to plain tiff(), and 2) R started crashing on me.The following code tiff("test.tif") plot(rnorm(100)) dev.off() ,crashes R (i.e "R GUI has encountered a problem and needs to close...") every third time or so. When it does work, the resulting output is not too pretty. So I turned to using postscript files. However, Plos One requires that fonts be embedded into the figure. embedFonts() works for this, but the result is that text becomes low-res bitmaps, and I don't know how to solve this. So basically my question is: How should I go about generating graphics that will look as nice as possible given the above constraints? Many thanks in advance, Gustaf -- Gustaf Rydevik, M.Sci. tel: +46(0)703 051 451 address:Essingetorget 40,112 66 Stockholm, SE skype:gustaf_rydevik
Gustaf Rydevik
2008-May-23 14:48 UTC
[R] Preparing high quality figures with tiff as end result
On Fri, May 23, 2008 at 4:40 PM, Gustaf Rydevik <gustaf.rydevik at gmail.com> wrote:> Hi all, > > I'm currently preparing some figures that will be submitted to PloS One. > In their guidelines they state that they will only accept figures in > tiff or eps format, with the warning that eps figures will be > converted to tiff format ( see > http://www.plosone.org/static/figureGuidelines.action ). > > Because of this conversion, I figured I'd generate tiff-format figures > from the beginning. > However, a number of issues cropped up: > 1) using > > library(Cairo) > CairoTIFF("test.tif") > > I get " Sorry, this Cairo was compiled without tiff support.". I tried > finding out how to recompile Cairo, but got lost in a lot of confusing > talk about GTK+, downloaded dll files that I didn't know how to use > etc. > > so I turned to plain tiff(), and > > 2) R started crashing on me.The following code > > tiff("test.tif") > plot(rnorm(100)) > dev.off() > > ,crashes R (i.e "R GUI has encountered a problem and needs to > close...") every third time or so. > When it does work, the resulting output is not too pretty. > > So I turned to using postscript files. However, Plos One requires that > fonts be embedded into the figure. > embedFonts() works for this, but the result is that text becomes > low-res bitmaps, and I don't know how to solve this. > > So basically my question is: How should I go about generating graphics > that will look as nice as possible given the above constraints? > > Many thanks in advance, > > Gustaf > >Oh, and before anyone bites my head of, I forgot the following:> sessionInfo()R version 2.7.0 (2008-04-22) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] RWinEdt_1.8-0 Cairo_1.4-2>, and I'm using windows XP professional again, many thanks in advance /Gustaf -- Gustaf Rydevik, M.Sci. tel: +46(0)703 051 451 address:Essingetorget 40,112 66 Stockholm, SE skype:gustaf_rydevik
Prof Brian Ripley
2008-May-23 15:34 UTC
[R] Preparing high quality figures with tiff as end result
Try bitmap(): this produces PostScript and converts with ghostscript. BTW, everything (including text) in TIFF files *is* 'low-res bitmaps' by definition, so you cannot avoid this. Anti-aliasing *may* help, and the bitmap() device in R-devel supports it. On Fri, 23 May 2008, Gustaf Rydevik wrote:> Hi all, > > I'm currently preparing some figures that will be submitted to PloS One. > In their guidelines they state that they will only accept figures in > tiff or eps format, with the warning that eps figures will be > converted to tiff format ( see > http://www.plosone.org/static/figureGuidelines.action ). > > Because of this conversion, I figured I'd generate tiff-format figures > from the beginning. > However, a number of issues cropped up: > 1) using > > library(Cairo) > CairoTIFF("test.tif") > > I get " Sorry, this Cairo was compiled without tiff support.". I tried > finding out how to recompile Cairo, but got lost in a lot of confusing > talk about GTK+, downloaded dll files that I didn't know how to use > etc. > > so I turned to plain tiff(), and > > 2) R started crashing on me.The following code > > tiff("test.tif") > plot(rnorm(100)) > dev.off() > > ,crashes R (i.e "R GUI has encountered a problem and needs to > close...") every third time or so. > When it does work, the resulting output is not too pretty.Which means what?> So I turned to using postscript files. However, Plos One requires that > fonts be embedded into the figure. > embedFonts() works for this, but the result is that text becomes > low-res bitmaps, and I don't know how to solve this. > > So basically my question is: How should I go about generating graphics > that will look as nice as possible given the above constraints? > > Many thanks in advance, > > Gustaf > > > > > -- > Gustaf Rydevik, M.Sci. > tel: +46(0)703 051 451 > address:Essingetorget 40,112 66 Stockholm, SE > skype:gustaf_rydevik > > ______________________________________________ > 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. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595