[R] Sweave: pass scale parameter to includegraphics?
Peter Dunn
dunn at usq.edu.au
Tue Jul 29 08:23:08 CEST 2003
Hi all
I'm using Sweave and find it a treat. But one
question:
I use Sweave to create my pictures which are
automatically included into LaTeX. For example,
in the file test.Snw, I may have:
% LaTeX stuff
\begin{figure}
<<fig=true,width=5,height=5>>=
x1 <- seq(1,5, length=10)
x2 <- sin(x1)
plot(x1,x2)
@
\caption{Plot}
\end{figure}
% More LaTeX
This produces the LaTeX file test.tex with the
(example) chuck:
% LaTeX stuff
\begin{figure}
\includegraphics{test-001}
\caption{Plot}
\end{figure}
% More LaTeX stuff
But what if I want the chunk to be, for example,
\includegraphics[scale=0.6]{test-001}
rather than the standard, no frills \includegraphics
command? (Why? Because I create a picture that I
want small! Changing width and height within the
<<>>= only changes the appearance of the picture--it
alters the x11 window the plot is produced in, not
the final size in my document.)
How can I inform Sweave to create this in the
LaTeX code (not universally, but in the occasional
picture)? More generally, how can I inform Sweave
to pass these types of parameters to the
\includegraphics command?
I have searched archives and all the (obvious to me)
places, but haven't found the solution.
Thanks again,
P.
--
Dr Peter Dunn (USQ CRICOS No. 00244B)
Web: http://www.sci.usq.edu.au/staff/dunn
Email: dunn @ usq.edu.au
Opinions expressed are mine, not those of USQ. Obviously...
More information about the R-help
mailing list