all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* export inline image from source results?
@ 2012-08-21 17:57 Petro
  2012-08-21 19:20 ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Petro @ 2012-08-21 17:57 UTC (permalink / raw)
  To: emacs-orgmode

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.
Thanks.
Petro

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: export inline image from source results?
  2012-08-21 17:57 export inline image from source results? Petro
@ 2012-08-21 19:20 ` Eric Schulte
  2012-08-21 20:41   ` Petro
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2012-08-21 19:20 UTC (permalink / raw)
  To: Petro; +Cc: emacs-orgmode

Petro <x.piter@gmail.com> 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
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: export inline image from source results?
  2012-08-21 19:20 ` Eric Schulte
@ 2012-08-21 20:41   ` Petro
  0 siblings, 0 replies; 3+ messages in thread
From: Petro @ 2012-08-21 20:41 UTC (permalink / raw)
  To: emacs-orgmode

Eric Schulte <eric.schulte@gmx.com> writes:

> Petro <x.piter@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-21 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-21 17:57 export inline image from source results? Petro
2012-08-21 19:20 ` Eric Schulte
2012-08-21 20:41   ` Petro

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.