Alice Johnstone
2010-Apr-13 03:41 UTC
[R] Help required with png graphic production as text has shadows?
I have produced a series of graphs with the png command, however when I have finally printed these out the black text appears to have a colour shadow with blue or red on either side of the letter. I tried increasing my res to 1200 and this improved it somewhat, but the text is still not sharp and occassionally these "shadows" will still print. I initially thought this was an issue with the printer.. But I can produce a pdf image and it is sharp. However as I have 50+ images I want to include in a word document the pdf files are much too large and was the reason I was using png. I am using an older version of R, but didn't want to upgrade as this may cause issues with my completed analyses and the potential changes to other functions. Can someone suggest what it is I have missed? Thank you very much. Alice Johnstone Example code: Png("volcano.png",units="cm",height=15,width=15,res=1200,pointsize=12) Volcano2(fit2.eb,coef=2,highlight=5,xlab="log fold change",ylab="log odds",pch=16,cex=0.5, main="Volcano Plot",xlim=c(-2,2)) Dev.off()> sessionInfo()R version 2.8.0 (2008-10-20) i386-pc-mingw32 locale: LC_COLLATE=English_New Zealand.1252;LC_CTYPE=English_New Zealand.1252;LC_MONETARY=English_New Zealand.1252;LC_NUMERIC=C;LC_TIME=English_New Zealand.1252 attached base packages: [1] grid splines tools stats graphics grDevices utils [8] datasets methods base other attached packages: [1] affyQCReport_1.20.0 arrayQualityMetrics_1.8.1 [3] marray_1.20.0 beadarray_1.10.0 [5] hwriter_0.93 latticeExtra_0.5-4 [7] simpleaffy_2.18.0 affyPLM_1.18.0 [9] preprocessCore_1.4.0 RColorBrewer_1.0-2 [11] vsn_3.8.0 genefilter_1.22.0 [13] survival_2.34-1 geneplotter_1.20.0 [15] annotate_1.20.0 xtable_1.5-4 [17] lattice_0.17-15 sma_0.5.15 [19] rat2302probe_2.3.0 rat2302cdf_2.3.0 [21] rat2302.db_2.2.5 RSQLite_0.7-1 [23] DBI_0.2-4 AnnotationDbi_1.4.0 [25] MASS_7.2-44 gcrma_2.14.0 [27] matchprobes_1.14.0 affy_1.20.0 [29] Biobase_2.2.0 limma_2.16.2 [31] gplots_2.6.0 gdata_2.4.2 [33] gtools_2.5.0 loaded via a namespace (and not attached): [1] affyio_1.10.0 KernSmooth_2.22-22 P Think before you print This e-mail transmission and any attachments that accompany it may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable law and is intended solely for the use of the individual(s) to whom it was intended to be addressed. If you have received this e-mail by mistake, or you are not the intended recipient, any disclosure, dissemination, distribution, copying or other use or retention of this communication or its substance is prohibited. If you have received this communication in error, please immediately reply to the author via e-mail that you received this message by mistake and also permanently delete the original and all copies of this e-mail and any attachments from your computer. Thank you.
Karl Ove Hufthammer
2010-Apr-13 06:51 UTC
[R] Help required with png graphic production as text has shadows?
Alice Johnstone wrote:> I have produced a series of graphs with the png command, however when I > have finally printed these out the black text appears to have a colour > shadow with blue or red on either side of the letter.What you?re seeing is likely subpixel antialiasing. How to ?fix? this depends on your platform. For Windows, I believe you have to turn off ClearType for fonts. For Linux, see ?X11.options. -- Karl Ove Hufthammer
Greg Snow
2010-Apr-13 13:59 UTC
[R] Help required with png graphic production as text has shadows?
Are you resizing the graphs at all? This can cause the shadows/blur, it is best to create the graphs at the exact size that you will end up using them so that there is no resizing (though I would not trust word to not resize even if you tell it not to). You may also want to try producing wmf files as they are vector based, but can be included in word and other ms products (but could suffer the same size issues as pdf). When pdf files are much larger than png files, it is usually because you are plotting many points and there is much overplotting, if that is the case, then you may want to try some different types of plots, for example, boxplots, hexbin plots, sunflower plots, or others. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Alice Johnstone > Sent: Monday, April 12, 2010 9:41 PM > To: r-help at R-project.org > Subject: [R] Help required with png graphic production as text has > shadows? > > I have produced a series of graphs with the png command, however when I > have finally printed these out the black text appears to have a colour > shadow with blue or red on either side of the letter. > I tried increasing my res to 1200 and this improved it somewhat, but > the text is still not sharp and occassionally these "shadows" will > still print. > > I initially thought this was an issue with the printer.. But I can > produce a pdf image and it is sharp. However as I have 50+ images I > want to include in a word document the pdf files are much too large and > was the reason I was using png. > > I am using an older version of R, but didn't want to upgrade as this > may cause issues with my completed analyses and the potential changes > to other functions. > > Can someone suggest what it is I have missed? > Thank you very much. > > Alice Johnstone > > Example code: > Png("volcano.png",units="cm",height=15,width=15,res=1200,pointsize=12) > Volcano2(fit2.eb,coef=2,highlight=5,xlab="log fold change",ylab="log > odds",pch=16,cex=0.5, main="Volcano Plot",xlim=c(-2,2)) > Dev.off() > > > > sessionInfo() > R version 2.8.0 (2008-10-20) > i386-pc-mingw32 > > locale: > LC_COLLATE=English_New Zealand.1252;LC_CTYPE=English_New > Zealand.1252;LC_MONETARY=English_New > Zealand.1252;LC_NUMERIC=C;LC_TIME=English_New Zealand.1252 > > attached base packages: > [1] grid splines tools stats graphics grDevices utils > [8] datasets methods base > > other attached packages: > [1] affyQCReport_1.20.0 arrayQualityMetrics_1.8.1 > [3] marray_1.20.0 beadarray_1.10.0 > [5] hwriter_0.93 latticeExtra_0.5-4 > [7] simpleaffy_2.18.0 affyPLM_1.18.0 > [9] preprocessCore_1.4.0 RColorBrewer_1.0-2 > [11] vsn_3.8.0 genefilter_1.22.0 > [13] survival_2.34-1 geneplotter_1.20.0 > [15] annotate_1.20.0 xtable_1.5-4 > [17] lattice_0.17-15 sma_0.5.15 > [19] rat2302probe_2.3.0 rat2302cdf_2.3.0 > [21] rat2302.db_2.2.5 RSQLite_0.7-1 > [23] DBI_0.2-4 AnnotationDbi_1.4.0 > [25] MASS_7.2-44 gcrma_2.14.0 > [27] matchprobes_1.14.0 affy_1.20.0 > [29] Biobase_2.2.0 limma_2.16.2 > [31] gplots_2.6.0 gdata_2.4.2 > [33] gtools_2.5.0 > > loaded via a namespace (and not attached): > [1] affyio_1.10.0 KernSmooth_2.22-22 > > P Think before you print > This e-mail transmission and any attachments that accompany it may > contain information that is privileged, confidential or otherwise > exempt from disclosure under applicable law and is intended solely for > the use of the individual(s) to whom it was intended to be addressed. > If you have received this e-mail by mistake, or you are not the > intended recipient, any disclosure, dissemination, distribution, > copying or other use or retention of this communication or its > substance is prohibited. If you have received this communication in > error, please immediately reply to the author via e-mail that you > received this message by mistake and also permanently delete the > original and all copies of this e-mail and any attachments from your > computer. Thank you. > > ______________________________________________ > 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.