From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] how to pass data to gnuplot from another block Date: Thu, 05 Dec 2013 11:29:15 -0700 Message-ID: <87siu7883o.fsf@gmail.com> References: <87d2lsbvy7.fsf@ucl.ac.uk> <87iovkihe6.fsf@gmail.com> <87vbz3lpi8.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VodoT-0005I9-2T for emacs-orgmode@gnu.org; Thu, 05 Dec 2013 13:38:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VodoO-0001HH-I9 for emacs-orgmode@gnu.org; Thu, 05 Dec 2013 13:38:13 -0500 Received: from mail-pb0-x22e.google.com ([2607:f8b0:400e:c01::22e]:50429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VodoO-0001FO-AL for emacs-orgmode@gnu.org; Thu, 05 Dec 2013 13:38:08 -0500 Received: by mail-pb0-f46.google.com with SMTP id md12so26609886pbc.33 for ; Thu, 05 Dec 2013 10:38:06 -0800 (PST) Received: from bagel (c-174-56-50-60.hsd1.nm.comcast.net. [174.56.50.60]) by mx.google.com with ESMTPSA id er3sm146253239pbb.40.2013.12.05.10.29.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Dec 2013 10:30:00 -0800 (PST) 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Eric S Fraga writes: > Eric Schulte writes: > >> Hi Eric, >> >> The attached works fine for me (using sh since I don't have octave). > > Dear Eric, > > thanks for your quick reply and sorry for taking so long to get back to > you. I ended up going to Chile for a week the day after sending my > original email and had very little Internet access (and, actually, no > time even if I had had proper connectivity). Back now! > > [...] > >> Ensure that the data you're passing into gnuplot is a table and not a >> string. Gnuplot blocks handle tables by writing them to a file, and >> then replacing the variable with the file name. As I recall gnuplot >> blocks assume string data already is a file name, so the variable is >> replaced directly. > > Ah ha, this is a subtle one! The output looks the same in either case, > as Nick D. also notes. By changing the results generated to value and > not output and adding an expression at the end of my octave code to > generate the value required got things working. > > The subtlety makes this a rather frustrating experience, however. Is > there any way to convince babel to treat a string output as an org table > so that subsequent chaining works in this case as well? > I'm not familiar with ob-octave, but I'd imagine ":results vector" should do the trick. If not then it might be worth adding something like the following (borrowed from ob-sh.el) to ob-octave. (org-babel-result-cond (cdr (assoc :result-params params)) results (let ((tmp-file (org-babel-temp-file "sh-"))) (with-temp-file tmp-file (insert results)) (org-babel-import-elisp-from-file tmp-file))) Best, > > Thanks again, > eric -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D