[R] changing figure size in Sweave

TEMPL Matthias Matthias.Templ at statistik.gv.at
Thu Nov 17 14:36:05 CET 2005


The Sweave User Manual says (p. 12):

Attention: One thing that gets easily confused are the width/height
parameters of the R
graphics devices and the corresponding arguments to the LATEX
\includegraphics command.
The Sweave options width and height are passed to the R graphics
devices, and hence affect
the default size of the produced EPS and PDF files. They do not affect
the size of figures in the
document, by default they will always be 80% of the current text width.
Use \setkeys{Gin}
to modify figure sizes or use explicit \includegraphics commands in
combination with Sweave
option include=FALSE.

I hope this helps.

Best,
Matthias


> 
> Hi
> 
> In Sweave, how does one change the size of the plots?
> 
> I tried using a hook:
> 
> 
> <<echo=FALSE, print=FALSE, fig=TRUE>>=
> options(SweaveHooks=list(fig=function() ps.options(width=1)))
> library(graphics)
> pairs(iris)
> @
> 
> but this didn't change the size of the figure.  How to make the  
> figures a
> different size?
> 
> 
> 
> --
> Robin Hankin
> Uncertainty Analyst
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
>   tel  023-8059-7743
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read 
> the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list