[R] sweave: graphics not at the expected location in the pdf

Don MacQueen macq at llnl.gov
Fri Jun 25 16:49:06 CEST 2004


This is actually a LaTeX question, not an R (or even Sweave, strictly 
speaking) question.

Here is what I have done. In the preamble, specify

\usepackage{here}

Then later on specify [H] when including a figure, as in:

\begin{figure}[H]
   \begin{center}
<<fig=TRUE,width=6.5,height=4>>=
plot(x,y)
@
     \caption{My plot\label{fig1}}
   \end{center}
\end{figure}

Is the "here" package *required* in order to use [H]? I don't know. I 
just found it mentioned in a LaTeX book, tried it, and it worked. The 
most helpful book I've found so far is
      Guide to LaTeX (fourth edition), by Helmut Kopka and Patrick W. Daly

And yes, Sweave is great!

-Don

At 1:51 PM +0200 6/25/04, Christoph Lehmann wrote:
>Hi
>
>I use sweave for excellent pdf output (thank you- Friedrich Leisch). I
>have just one problem. Quite often it happens, that the graphics are not
>at the place where I expect them, but (often on a separate page) later
>on in the pdf. How can I fix this, means how can I define, that I want a
>graphic exactly here and now in the document?
>
>Many thanks and best regards
>
>Christoph
>--
>Christoph Lehmann <christoph.lehmann at gmx.ch>
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA




More information about the R-help mailing list