[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Beginning R plot export
From: |
John Tait |
Subject: |
Re: [O] Beginning R plot export |
Date: |
Wed, 11 May 2011 18:26:25 +0100 |
Thank-you! I now have a little plot in my PDF!
John
On 5/11/11, Nick Dokos <address@hidden> wrote:
> John Tait <address@hidden> wrote:
>
>> Hi
>>
>> Do I need to do extra configuration to get R plot output in LaTeX exports?
>>
>> Using the simplest code block:
>>
>> #+SRCNAME: graph
>> #+BEGIN_SRC R :exports both
>> x=c(1,2)
>> y=c(2,4)
>> plot(x,y)
>> x
>> #+END_SRC
>>
>> The numbers "1 2" appear in the LaTeX output, indicating that R is
>> running. The plot doesn't appear though. What am I missing?
>>
>
> The following works for me:
>
> --8<---------------cut here---------------start------------->8---
> #+SRCNAME: graph
> #+BEGIN_SRC R :exports both :results graphics :file foo.png
> x=c(1,2)
> y=c(2,4)
> plot(x,y)
> #+END_SRC
> --8<---------------cut here---------------end--------------->8---
>
> Nick
>