I am attempting to get publication quality graphs using R on Ubuntu. I encounter lots of problems in using cex to control font size: for instance cex=1.5 results in very blocky characters. I then tried to use res=1200 while creating a PNG file, hoping that this would solve the problem, but it did not. When doing the above, a second problem appeared: the font size relative to the graphics decreased drastically. e.g. png("t1.png", res=1200, width=1200, height=1200). Is anyone prepared to give me a pointer of where to read about precise control over font type and font size in base graphics? I have two books on R graphics but this aspect is never treated in detail in any of them. Kind regards, willemf. -- View this message in context: http://www.nabble.com/Font-quality-in-base-graphics-tp18465608p18465608.html Sent from the R help mailing list archive at Nabble.com.
willemf wrote on 07/15/2008 08:42 AM:> I am attempting to get publication quality graphs using R on Ubuntu. I > encounter lots of problems in using cex to control font size: for instance > cex=1.5 results in very blocky characters. I then tried to use res=1200 > while creating a PNG file, hoping that this would solve the problem, but it > did not. When doing the above, a second problem appeared: the font size > relative to the graphics decreased drastically. e.g. png("t1.png", res=1200, > width=1200, height=1200). Is anyone prepared to give me a pointer of where > to read about precise control over font type and font size in base graphics? > I have two books on R graphics but this aspect is never treated in detail in > any of them. Kind regards, willemf.You may find some help with the Cairo package, which allows one to select desired truetype and opentype fonts using the fontconfig library. Be sure to thoroughly read the CairoFonts and CairoFontMatch help pages to learn how to carefully select your fonts. The benefit of using Cairo is that your png graphics have a better chance of looking exactly like your pdf graphics since Cairo embeds the fonts into the pdf by default. Knowing which journal you're publishing in and their graphic requirements would be helpful to further solve your problem. Some researchers here at Vanderbilt have had success saving graphics as pdf's (with or without Cairo), then either using gimp or the imagemagic command convert to "upscale" the graphic to a desired dpi setting. Best, Jeff -- http://biostat.mc.vanderbilt.edu/JeffreyHorner
Thank you Jeff, I will follow up on this. I just cannot believe that R does not have a good command of this. The obvious route is Postscript ourput, since it is not raster-based and one can incorporate EPS files into OpenOffice documents. However, when printing to a Postscript device, there is no control over the size of the text with respect to the graphics (at least I have not managed to obtain that level of control, even when restricting graphic size by specifying fin = c(3,3). The fundamental challenge for R is to generate identical copies of onscreen/pdf/PNG/postscript output. As far as I deduce this is not possible at present. Thanks for your comments. Regards, wf -- View this message in context: http://www.nabble.com/Font-quality-in-base-graphics-tp18465608p18473186.html Sent from the R help mailing list archive at Nabble.com.
willemf wrote on 07/15/2008 08:42 AM:> I am attempting to get publication quality graphs using R on Ubuntu. I > encounter lots of problems in using cex to control font size: for instance > cex=1.5 results in very blocky characters. I then tried to use res=1200 > while creating a PNG file, hoping that this would solve the problem, but it > did not. When doing the above, a second problem appeared: the font size > relative to the graphics decreased drastically. e.g. png("t1.png", res=1200, > width=1200, height=1200). Is anyone prepared to give me a pointer of where > to read about precise control over font type and font size in base graphics? > I have two books on R graphics but this aspect is never treated in detail in > any of them. Kind regards, willemf.Any reason not to use PDF or EPS? They are vector graphics formats and will provide better text. -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement.