[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] are babel python sessions and inlined images incompatible?
From: |
Sebastien Vauban |
Subject: |
Re: [O] are babel python sessions and inlined images incompatible? |
Date: |
Wed, 24 Apr 2013 23:06:30 +0200 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3 (windows-nt) |
Hello Rodrigo,
Rodrigo Amestica wrote:
> Eric Schulte wrote:
>> Rodrigo Amestica <address@hidden> writes:
>>
>> > if I use this block
>> >
>> > #+BEGIN_SRC python :results file
>> > from pylab import *
>> > plot(rand(10))
>> > savefig('images/test.png')
>> > return 'images/test.png'
>> > #+END_SRC
>> >
>> > then the RESULTS block shows me an inlined version of the plot.
>> >
>> > If now I switch to this block
>> >
>> > #+BEGIN_SRC python :session test :results file
>> > from pylab import *
>> > plot(rand(10))
>> > savefig('images/test.png')
>> > return 'images/test.png'
>> > #+END_SRC
>
> many thanks for the feed back Eric!
>
>> You don't need to explicitly specify a return when working with a
>> session. Either of the following should work.
>>
>> #+BEGIN_SRC python :session test :file "images/test.png"
>> from pylab import *
>> plot(rand(10))
>> savefig('images/test.png')
>> #+END_SRC
>
> that does not quite work, I get no inlined image but the following line in the
> Messages buffer
>
> orgtbl-format-line: Wrong type argument: sequencep,
> <matplotlib\.lines\.Line2DError during redisplay: (wrong-type-argument arrayp
> nil)
Try adding the `:results graphics' header argument...
>> #+BEGIN_SRC python :session test :results file
>> from pylab import *
>> plot(rand(10))
>> savefig('images/test.png')
>> 'images/test.png'
>> #+END_SRC
>
> that one works!
Best regards,
Seb
--
Sebastien Vauban
- [O] are babel python sessions and inlined images incompatible?, Rodrigo Amestica, 2013/04/23
- Re: [O] are babel python sessions and inlined images incompatible?, Eric Schulte, 2013/04/23
- Re: [O] are babel python sessions and inlined images incompatible?, Rodrigo Amestica, 2013/04/23
- Re: [O] are babel python sessions and inlined images incompatible?,
Sebastien Vauban <=
- Re: [O] are babel python sessions and inlined images incompatible?, Rodrigo Amestica, 2013/04/24
- Re: [O] are babel python sessions and inlined images incompatible?, Sebastien Vauban, 2013/04/25
- Re: [O] are babel python sessions and inlined images incompatible?, Thomas S. Dye, 2013/04/26
- Re: [O] are babel python sessions and inlined images incompatible?, Sebastien Vauban, 2013/04/26
- Re: [O] are babel python sessions and inlined images incompatible?, Rasmus, 2013/04/26
- Re: [O] are babel python sessions and inlined images incompatible?, Achim Gratz, 2013/04/27
- Re: [O] are babel python sessions and inlined images incompatible?, Sebastien Vauban, 2013/04/27