From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: are babel python sessions and inlined images incompatible?
Date: Wed, 24 Apr 2013 23:06:30 +0200 [thread overview]
Message-ID: <86ehdzzlih.fsf@somewhere.org> (raw)
In-Reply-To: ybizjwoevss.wl%ramestica@lavabit.com
Hello Rodrigo,
Rodrigo Amestica wrote:
> Eric Schulte wrote:
>> Rodrigo Amestica <ramestica-N9AOi2cAC9ZBDgjK7y7TUQ@public.gmane.org> 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
next prev parent reply other threads:[~2013-04-24 21:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 4:10 are babel python sessions and inlined images incompatible? Rodrigo Amestica
2013-04-23 13:29 ` Eric Schulte
2013-04-23 22:17 ` Rodrigo Amestica
2013-04-24 21:06 ` Sebastien Vauban [this message]
2013-04-24 23:33 ` Rodrigo Amestica
2013-04-25 7:40 ` Sebastien Vauban
2013-04-25 16:27 ` Thomas S. Dye
2013-04-26 13:21 ` Sebastien Vauban
2013-04-26 22:13 ` Rasmus
2013-04-27 6:27 ` Achim Gratz
2013-04-27 6:40 ` Sebastien Vauban
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ehdzzlih.fsf@somewhere.org \
--to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).