我用这个代码,以使数据在Sweave
并排侧数字在Sweave
<<label=fig1plot, include=FALSE >>=
plot(cars)
@
\begin{figure}
\begin{center}
<<label=fig1, fig=TRUE, echo=FALSE>>=
<<fig1plot>>
@
\end{center}
\caption{Some caption}
\label{fig:fig1plot}
\end{figure}
<<label=fig2plot, include=FALSE >>=
plot(table(rpois(100,5)), type = "h", col = "red", lwd=10, main="rpois(100,lambda=5)")
@
\begin{figure}
\begin{center}
<<label=fig2, fig=TRUE, echo=FALSE>>=
<<fig2plot>>
@
\end{center}
\caption{Some caption}
\label{fig:fig2plot}
\end{figure}
现在我想把这两个数字并排侧,有图1(a)和类似标题图1(b)。任何想法,意见和指导方针,高度赞赏。预先感谢您的时间和帮助。
在添加'\ usepackage {subcaption}'到我的sweave文档序言中之前,即使在添加任何子图之前,我都会收到类似“\ caption”的消息,因为它已被文档类或程序包重新定义, caption包,'subcaption'包不能正常工作。“我猜这个答案被接受后,事情已经发生了变化... – liori