I am using ggplot2 (respectively qplot) to generate a report with Sweave. Now I need some help with the adjustment of the size of the plot. I use the following Sweave code t
Instead of doing this within ggplot2, add the following LaTeX code before the code chunk where you print the graph.
\SweaveOpts{width=x, height=y}
x and y are height and width in inches.
If there is a particular aspect ratio you would like your plot to be, you can set this in ggplot2 with opts(). Unless I have some other reason, I usually try to keep my plots scaled to the golden ratio, per Tufte's suggestions. Usually I have
...
SweaveOpts{width=8, height=5}
...
<