Hi, I'm trying to realise a repport with R and Latex (TeXnicCenter and Miktex for Windows) using Sweave(). I'd like to save my plots in a given size. How can I do that ? The code is : \SweaveOpts{prefix.string = figs/plot, eps = FALSE, pdf = TRUE} <<partI, echo=FALSE ,fig=TRUE, include=FALSE>>= plotFunction() @ \includepdf[pages=-]{figs/plot-partI} When I use par(pin=c(width,height)), I get the plot with the right size but saved in a too big pdf page (7in x 7in, the default size of the window). So I tried to change the size of the window with the command windows() but then, Sweave can't save the plot correctly. Thanks everyone. Lore. _________________________________________________________________ ? Lancez-vous ! [[alternative HTML version deleted]]
Wolfgang Raffelsberger
2009-Apr-14 10:42 UTC
[R] using Sweave, how to save a plot in a given size
Hi I do somthing like: \SweaveOpts{prefix.string=proj1} <<label=fig1,fig=T,include=F,width=8, height=12>>plot(1:10) @ \begin{figure} \includegraphics {proj1-fig1} %% show \label{..} \end{figure} Wolfgang Lore M a ?crit :> > > > > > > Hi, > > I'm trying to realise a repport with R and Latex (TeXnicCenter and Miktex for Windows) using Sweave(). > I'd like to save my plots in a given size. How can I do that ? The code is : > > \SweaveOpts{prefix.string = figs/plot, eps = FALSE, pdf = TRUE} > <<partI, echo=FALSE ,fig=TRUE, include=FALSE>>= > plotFunction() > @ > \includepdf[pages=-]{figs/plot-partI} > > When I use par(pin=c(width,height)), I get the plot with the right size but saved in a too big pdf page (7in x 7in, the default size of the window). > So I tried to change the size of the window with the command windows() but then, Sweave can't save the plot correctly. > > Thanks everyone. > > Lore. > _________________________________________________________________ > > ? Lancez-vous ! > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > > >-- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wolfgang Raffelsberger, PhD Laboratoire de BioInformatique et G?nomique Int?gratives CNRS UMR7104, IGBMC 1 rue Laurent Fries, 67404 Illkirch Strasbourg, France Tel (+33) 388 65 3300 Fax (+33) 388 65 3276 wolfgang.raffelsberger (at) igbmc.fr
Possibly Parallel Threads
- using Sweave, how to save a plot in a given size
- Sweave, how to save plots with a defined size and how to include several pdf pages on the same line
- alternatives to traditional least squares method in linear regression ?
- how to make a function recognize the name of an object/vector given as argument
- Sweave: Conditional code chunks?