Re: [R] using Sweave, how to save a plot in a given size

2009-04-15 Thread Lore M
Yes it works, but I still have a problem. The thing is that I know the dimensions of my plot but in the R code, not in the latex code. So I tried to do : \SweaveOpts{prefix.string=proj1} label=fig1,fig=T,include=F,width=\Sexpr{wid}, height=\Sexpr{hei}= plot(1:10) @ \begin{figure}

Re: [R] using Sweave, how to save a plot in a given size

2009-04-15 Thread ONKELINX, Thierry
Dear Lore, The easiest thing to do is to write a function that saves your plot to a file and generates the latex code. label=fig1, fig=FALSE, result = tex= pdf(fig1.pdf, width = wid, heigth = hei) plot(1:10) dev.off() cat(\begin{figure}\) cat(\includegraphics[width = , wid, , height = ,

Re: [R] using Sweave, how to save a plot in a given size

2009-04-15 Thread Lore M
After few corrections, it does work. But I have several plots to include in my document and, because of those commands, they're all on the same line even if there are 20 plots. I mean that Latex doesn't car about textwidth anymore and I get an overfull box (too wide). What could I do to

Re: [R] using Sweave, how to save a plot in a given size

2009-04-15 Thread ONKELINX, Thierry
This seems more a LaTeX problem than an R problem. But can you provide us (an sample example of) the LaTeX code the yields the overfull box. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research

Re: [R] using Sweave, how to save a plot in a given size

2009-04-15 Thread Lore M
You're right, I'm sorry to disturb you with my Latex problem. If anyone has an idea, here is the Latex code that I get : \begin{figure} \multido{\i=1+1}{7}{\includegraphics[page=\i,width=1.5in, height = 1.5in]{image.pdf} \\ } \end{figure} I tried to break the line with \\ or with \linebreak

Re: [R] using Sweave, how to save a plot in a given size

2009-04-15 Thread Lore M
I just want to add that I didn't have any overful box before I use : label=fig1, fig=FALSE, results = tex= pdf(fig1.pdf, width = wid, heigth = hei) plot(1:10) plot(1:10) dev.off() cat(\\begin{figure}[h]) cat(\\centering) cat(\\multido{\i=1+1}{7}{\includegraphics[page=\i,width=1.5in, height =

Re: [R] using Sweave, how to save a plot in a given size

2009-04-15 Thread cls59
Lo_Lo wrote: I just want to add that I didn't have any overful box before I use : label=fig1, fig=FALSE, results = tex= pdf(fig1.pdf, width = wid, heigth = hei) plot(1:10) plot(1:10) dev.off() cat(\\begin{figure}[h]) cat(\\centering)

[R] using Sweave, how to save a plot in a given size

2009-04-14 Thread Lore M
Hi, I'm trying to realise a repport with R and Latex (TeXnicCenter and Miktex for Windows) using Sweave(). I'd like to save my plots in a given size. How can I do that ? The code is : \SweaveOpts{prefix.string = figs/plot, eps = FALSE, pdf = TRUE} partI, echo=FALSE ,fig=TRUE,

Re: [R] using Sweave, how to save a plot in a given size

2009-04-14 Thread Wolfgang Raffelsberger
Hi I do somthing like: \SweaveOpts{prefix.string=proj1} label=fig1,fig=T,include=F,width=8, height=12= plot(1:10) @ \begin{figure} \includegraphics {proj1-fig1} %% show \label{..} \end{figure} Wolfgang Lore M a écrit : Hi, I'm trying to realise a repport with R and Latex