[R] rotated figures within Sweave?

Jeff D. Hamann jeff.hamann at forestinformatics.com
Thu Nov 2 22:31:15 CET 2006


Doh! I completely forgot about the LaTeX \begin{}\end{} environments!

\begin{figure}[p]
  \centering
<<fig=TRUE, echo=false, width=9>>=
plot( ... )
@
\end{figure}

should have been...

\begin{sidewaysfigure}[p]
  \centering
<<fig=TRUE, echo=false, width=9>>=
plot( ... )
@
\end{sidewaysfigure}

And since I use the sidewaysfigure environment all the time, I should have
known... my bad.

Jeff.

-- 
Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon 97339-1421

> On Thu, 2006-11-02 at 11:03 -0800, Jeff D. Hamann wrote:
>> I can't recall (or find an example of) how to rotate figures in Sweave:
>>
>> <<fig=TRUE, echo=false, width=9, landscape=TRUE>>= ???
>> <<fig=TRUE, echo=false, width=9, rotate=true>>= ???
>> <<fig=TRUE, echo=false, width=9, sideways=TRUE>>= ???
>> <<fig=TRUE, echo=false, width=9, par=(something)>>= ???
>>
>> Does anyone know how to do this?
>
> Jeff,
>
> I don't know if Sweave can do this directly, though I have not tried.
>
> Rather, there are LaTeX packages that can do this. The key is whether or
> not you want to rotate just the figure, the figure and the caption or
> the entire page upon which the figure is located.
>
> Typically, I do the latter and use the 'landscape' environment for one
> or more entire pages (notably where I have wide tables). This rotates
> the entire page, but leaves any headers/footers in portrait mode.
>
> There are also 'sidewaysfigure' and 'sidewaystable' environments and
> other options that might be applicable to what you want.
>
> There is a PDF file that covers this called rotating.pdf.  A link to it
> is:
>
>   www.perce.de/LaTeX/rotating.pdf
>
> with a CTAN link here:
>
>   http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=rotating
>
> The former has examples of rotated figures within a portrait orientation
> page and other such machinations.
>
> HTH,
>
> Marc Schwartz
>
>
>



More information about the R-help mailing list