[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] export inline image from source results?
From: |
Petro |
Subject: |
Re: [O] export inline image from source results? |
Date: |
Tue, 21 Aug 2012 22:41:51 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Eric Schulte <address@hidden> writes:
> Petro <address@hidden> writes:
>
>> Hi all.
>> I generate an image from python source like this:
>> _____________________________________________________
>> #+BEGIN_SRC python :results output raw :export results
>> from pylab import figure, plot
>> import pylab as plt
>> import numpy as np
>> plt.ioff()
>> figure()
>> plot(np.random.rand(10),'o')
>> pic_name='fit_rates1.svg'
>> path_name='/home/petro/tmp/'
>> plt.savefig(path_name + pic_name)
>> print "[" + "[" + path_name + pic_name +"]]"
>>
>> #+END_SRC
>>
>> #+RESULTS:
>> [[/home/petro/tmp/fit_rates1.svg]]
>>
>> _____________________________________________________
>> Can I export the result? Rigth now the image is exported only if I copy the
>> image link and
>> paste it few lines below.
>
> Hi Petro,
>
> Is the link exported at all, or do you get no results export?
>
> You could add the following additional header argument to your code
> block to inform org-mode that the results are a link to a file.
>
> :file /home/petro/tmp/fit_rates1.svg
>
> Best,
>
>>
>> Thanks.
>> Petro
>>
I think I cannot use :file header argument, if I remember well with this
argument org-mode will create a new results file overwriting the one
created by a command in the source code.
My problem solved. I've made a mistake of using :export instead of
:exports in the source header. Now everything works.
Thanks
Petro