Consider these two chunks:
\subsection{Section figure 1}
\begin{figure}[!h]
<<figure1>>=
plot(1, 1)
@
\caption{Figure 1}
\end{figure}
\newpage
\subsection{Section figure 2}
<<figure2, fig.cap="figure 2", fig.show='asis'>>=
plot(2, 2)
@
The plot is located after the "Section figure x" title in the first chunk but before in the second one. However, based on documentation, it seems to me that these two chunks should be similar.
So my question: how to show the plot after title section using fig.cap="figure 2".
I try this solution:
\subsection{Essai figure 2 bis}
\begin{figure}[!h]
\end{figure}
<<figure2bis, fig.cap="figure 2 bis", fig.show='asis'>>=
plot(2.5, 2.5)
@
But it generates a page with only the section title before the plot.
Thanks a lot
Marc