我发现了这个关于在 Sweave 中更改 ggplot2 图的大小的问题。我添加了Sweaveopts{width=3, height=3}
它,它确实缩小了绘图的大小,但它并没有缩小文本。所以最后,轴上的所有数字都重叠了。
有没有办法在 Sweave 中缩放整个 ggplot2 图,这样我就不必手动缩放原始 ggplot2 调用中的每个组件?这似乎是我应该能够做的事情,但我在 ggplot2 书或网站上找不到它。谢谢!
FWIW,这是我在 Sweave 中的电话:
\SweaveOpts{width=3, height=3}
\begin{figure}
\begin{center}
<<fig=TRUE>>=
print(plot.m)
@
\end{center}
\caption{stuff}
\label{fig:stuff}
\end{figure}
以及生成 ggplot2 图的调用:
plot.m <- ggplot(temp, aes(date, spread)) + geom_bar(stat="identity") + scale_x_date(major="years", minor="months")