[R] rotated figures within Sweave?

Marc Schwartz marc_schwartz at comcast.net
Thu Nov 2 21:04:34 CET 2006


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