Here is a minimal example:
\documentclass{article}
\begin{document}
<<fig.height=4,out.width=\textwidth,echo=FALSE>>=
plot(1,1)
plot(2,2)
@
\newpage
<<fig.height=4,out.width=\textwidth,echo=TRUE>>=
plot(1,1)
plot(2,2)
@
\end{document}
Note the screenshots below.
If echo=FALSE
, horizontal alignment is off. The top plot is shifted to the right relative to the bottom plot.
If echo=TRUE
, horizontal alignment is correct
How would I fix the first example to align correctly with echo=FALSE
?
Thank you!