emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
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: Thu, 25 Apr 2013 09:40:08 +0200	[thread overview]
Message-ID: <86r4hzgisn.fsf@somewhere.org> (raw)
In-Reply-To: <ybik3nry05j.wl%ramestica@lavabit.com>

Hi Rodrigo,

Rodrigo Amestica wrote:
> Sebastien Vauban wrote:
>>>> 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...
>
> it does not help. Still same error. I'm using org-7.9.4 from tarball, in
> ob.el there is no 'graphics' option defined for :results.

Well, I *now* know it's not described in the Org manual...

  ╭──── http://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg01181.html
  │
  │ - :results graphics makes the list even longer, yes?  :-) I'm not
  │   sure that every language supports it and I don't believe it's
  │   currently in the manual.
  ╰────

Though, it's described in many different posts on this ML, and in some
tutorials on Worg...

  ╭──── http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
  │
  │ If a :file filename.ext header argument is provided to an R source block, then
  │ the output from the source block will go to the named file. What that output
  │ is depends on the value of the :results header argument.
  │
  │ If the value is :results graphics then "base" graphics output is captured on
  │ disk, and a link to the graphics file is inserted into the Org Mode buffer (as
  │ is also the case with the graphics-only languages such as gnuplot, ditaa, dot,
  │ and asymptote.)
  ╰────

I thought it was a "core" option value for all general-purpose languages (e.g.
emacs-lisp, python, R, ruby, sh), required when your code block outputs a
graphics.

After checking, I only found it in those files:

--8<---------------cut here---------------start------------->8---
./ob-maxima.el:117:  (and (member "graphics" (cdr (assq :result-params params)))
./ob-octave.el:272:  (and (member "graphics" (cdr (assq :result-params params)))
./ob-R.el:234:  (and (member "graphics" (cdr (assq :result-params params)))
--8<---------------cut here---------------end--------------->8---

Maybe they are the only general-purpose languages able to output graphics? No,
wait, your example shows that python is also able to do so.

Then, I don't understand what that ":results graphics" option is not part of
python. Sorry not to be of more help...

Best regards,
  Seb

-- 
Sebastien Vauban

  reply	other threads:[~2013-04-25  7:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23  4:10 Rodrigo Amestica
2013-04-23 13:29 ` Eric Schulte
2013-04-23 22:17   ` Rodrigo Amestica
2013-04-24 21:06     ` Sebastien Vauban
2013-04-24 23:33       ` Rodrigo Amestica
2013-04-25  7:40         ` Sebastien Vauban [this message]
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=86r4hzgisn.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    --subject='Re: are babel python sessions and inlined images incompatible?' \
    /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

Code repositories for project(s) associated with this 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).