Hi, I am trying to use ggplot2 graphics with Sweave, but I got problems with transparency support when generating pdf figures, even if I specify a ?pdf.version? argument in Sweave options. More precisely, forcing the pdf version by creating the file manually works : <<fig=FALSE,results=HIDE>>pdf(version="1.4",file="foo.pdf") ggplot(d,aes(y=t,x=u)) + geom_point(colour=alpha('black', 0.05)) dev.off() @ \includegraphics{foo.pdf} Using the pdf.version argument without using ggplot works, too : \SweaveOpts{echo=FALSE,pdf.version=1.4} <<fig=TRUE>>plot(t,u,col=rgb(0,0,0,0.1)) @ But the following doesn't work (and this is what I would like to do) : \SweaveOpts{echo=FALSE,pdf.version=1.4} <<fig=TRUE>>ggplot(d,aes(y=t,x=u)) + geom_point(colour=alpha('black', 0.05)) @ Does anyone have an idea about this ? Thanks in advance, Julien -- Julien Barnier Groupe de recherche sur la socialisation ENS-LSH - Lyon, France
Dear Julien,> Hi, > > I am trying to use ggplot2 graphics with Sweave, but I got problems > with transparency support when generating pdf figures, even if I > specify a ?pdf.version? argument in Sweave options. >[...snip...] I wanted to help because I'm interested by the exploitation of the alpha channel in Sweave documents too... However, i) Despite its annoncment in fortune("mind_read"), the mind_read() function is apparently not to be released in R 2.6.0, so that if you could just follow the posting guide and give a reproducible example... ii) Give the output of your sessionInfo(). You can use something like that in your *.rnw file: <<sessionInfo, results=tex, echo=F>>toLatex(sessionInfo()) @ iii) What do you mean exactly by "doesn't work"? Put the source and the output somewhere on the web so that we can see both. Sincerely, -- Jean R. Lobry (lobry at biomserv.univ-lyon1.fr) Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I, 43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE allo : +33 472 43 27 56 fax : +33 472 43 13 88 http://pbil.univ-lyon1.fr/members/lobry/