Dear R users, I am using Sweave. I would like to use the width option for the graphics : \begin{figure}[h!] \centering \includegraphics[width=0.7\textwidth]{x} \end{figure} How do I get this ? Thank you very much, Randall [[alternative HTML version deleted]]
Dear Randall I do it like this: \begin{center} \setkeys{Gin}{width=0.7\textwidth} \begin{Scode}{fig=T, echo=F} ... \end{Scode} \end{center} Hope this helps. Karen On Wed 18Aug10, Randall Wrong wrote:> Dear R users, > > I am using Sweave. > > I would like to use the width option for the graphics : > > \begin{figure}[h!] > \centering > \includegraphics[width=0.7\textwidth]{x} > \end{figure} > > How do I get this ? > > Thank you very much, > Randall > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. >-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Please read the Sweave documentation. The default is set to 0.8\textwidth. You have to change a \SweaveOpt. On Aug 17, 2010 7:00 PM, "Randall Wrong" <randall.wrong@gmail.com> wrote: Dear R users, I am using Sweave. I would like to use the width option for the graphics : \begin{figure}[h!] \centering \includegraphics[width=0.7\textwidth]{x} \end{figure} How do I get this ? Thank you very much, Randall [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
No, the \setkeys statement should be in the main body of the Sweave file, not in the R code part. On Aug 18, 2010 9:20 AM, "Randall Wrong" <randall.wrong@gmail.com> wrote: Thanks Karen and Abhijit. I have read the section 4.1.2 of the Sweave user manual. Actually the manual lacks example code. I would like to change the option in "includegraphics", not to change the true sizes of the pictures. This is what I usually do : \begin{figure} \centering <<echo=false,fig=true>>print( acfplot( x ) ) @ \end{figure} Should I write : \begin{figure} \setkeys{Gin}{width=0.7\textwidth} \centering <<echo=false,fig=true>>print( acfplot( x ) ) @ \end{figure} ? Thanks for your help, Randall 2010/8/18 Karen Kotschy <karen@sevenc.co.za>> Dear Randall > > I do it like this: > > \begin{center} > \setkeys{Gin}{width=0.7\textwidth} > \begin{Scode}{fig=T, echo=F} > ... > \end{Scode} > \end{center} > > Hope this helps. > > Karen> > On Wed 18Aug10, Randall Wrong wrote: > > Dear R users, > > > > I am using Sweave. > > > > I woul... > R-project.org/posting-guide.html<r-project.org/posting-guide.html>> > and provide commented, minimal, self-contained, reproducible code. > > > > > > -- > > This message has been scanned for viruses and > > dangerous content by MailScanner, and is > > believed to be clean. > > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean.> >[[alternative HTML version deleted]] ______________________________________________ R-help@r-... [[alternative HTML version deleted]]