From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: are babel python sessions and inlined images incompatible? Date: Thu, 25 Apr 2013 09:40:08 +0200 Message-ID: <86r4hzgisn.fsf@somewhere.org> References: <8738uhmget.fsf@gmail.com> <86ehdzzlih.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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, >>> >> 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... =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 http://lists.gnu.org/archiv= e/html/emacs-orgmode/2013-03/msg01181.html =E2=94=82 =E2=94=82 - :results graphics makes the list even longer, yes? :-) I'm n= ot =E2=94=82 sure that every language supports it and I don't believe it's =E2=94=82 currently in the manual. =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 Though, it's described in many different posts on this ML, and in some tutorials on Worg... =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 http://orgmode.org/worg/org= -contrib/babel/languages/ob-doc-R.html =E2=94=82 =E2=94=82 If a :file filename.ext header argument is provided to an R sou= rce block, then =E2=94=82 the output from the source block will go to the named file. Wha= t that output =E2=94=82 is depends on the value of the :results header argument. =E2=94=82 =E2=94=82 If the value is :results graphics then "base" graphics output i= s captured on =E2=94=82 disk, and a link to the graphics file is inserted into the Org = Mode buffer (as =E2=94=82 is also the case with the graphics-only languages such as gnupl= ot, ditaa, dot, =E2=94=82 and asymptote.) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 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 para= ms))) ./ob-octave.el:272: (and (member "graphics" (cdr (assq :result-params para= ms))) ./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 --=20 Sebastien Vauban