[R] Sweave - landscape figure

Marc Schwartz marc_schwartz at me.com
Thu Aug 4 22:09:24 CEST 2011


On Aug 4, 2011, at 2:40 PM, Eduardo M. A. M. Mendes wrote:

> Dear R-users
> 
> I am trying to understand how Sweave works by running some simple examples.  In the example I am working with there is a chunk where the R-commands related to plotting a figure are placed.  When running R CMD Sweave … , pdflatex the output is a portrait figure.  I wonder whether it would be possible to change the orientation to landscape (not in the latex file but in Rnw file).
> 
> Many thanks
> 
> Ed


You can use the lscape package by placing:

  \usepackage{lscape}

in your LaTeX preamble in the .Rnw file. Then use:

\begin{landscape}

  other code here

\end{landscape}

That way you can create a landscape oriented page within a document that might otherwise contain portrait orientation pages.

HTH,

Marc Schwartz



More information about the R-help mailing list