[R] Sweave figure

Georg Otto georg.otto at tuebingen.mpg.de
Wed Jul 9 20:57:53 CEST 2008


I have a problem using figures in Sweave:

To save my figures, I use 


I adjust the figure size for my pdf document using

<<graphicsFun, fig=TRUE, echo=FALSE, height=10, width=5, eval=TRUE>>=

this works fine. The file 


has the right size, and so has the figure in the final pdf
document. The problem is, that during Sweave'ing, the plot is printed
also to the active x11 device, which has default size settings. In
some cases, this results in an error, because some parameters
(e.g. margins) might not be compatible with the default size. I think
the best solution would be to supress printing to the x11 device by
that code chunk, since I do not really need this side effect, but I
have not found how to do this and do not know if this is possible. Any



More information about the R-help mailing list