From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [babel] Producing figures from octave Date: Wed, 31 Aug 2011 20:47:04 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyyFP-0006WR-GA for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 23:47:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyyFO-0000it-6i for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 23:47:23 -0400 Received: from lo.gmane.org ([80.91.229.12]:43600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyyFN-0000ik-WB for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 23:47:22 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QyyFM-0001S3-An for emacs-orgmode@gnu.org; Thu, 01 Sep 2011 05:47:20 +0200 Received: from c-24-7-32-167.hsd1.ca.comcast.net ([24.7.32.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Sep 2011 05:47:20 +0200 Received: from dandavison7 by c-24-7-32-167.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Sep 2011 05:47:20 +0200 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 Ethan Ligon writes: > Dan Davison has a brief worg tutorial on using babel with octave at > > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-octave-matlab.html > Hi Ethan, > Amongst other things, he offers the following example block for > producing a figure: (Actually, the example is not by me.) > #+begin_src octave :output file :file chart.png > figure( 1, "visible", "off" ); > sombrero; > print -dpng chart.png > #+end_src :output file is wrong (there's no header arg named :output). :file chart.png says to write the results to that file. The "results" are whatvever the variable `ans` holds at the end of the block, and I think that must be the file path you're seeing. One way to write that example is: #+begin_src octave :results file figure( 1, "visible", "off" ); sombrero; print -dpng chart.png; ans = "chart.png"; #+end_src :results file says to interpret the result as a file path. I've updated the worg page. Dan > However, rather than delivering the png figure, the file chart.png > consists solely of the string "/usr/share/octave/packages/3.2". I'm > not sure where this string is coming from: > it's *not* part of the > stuff that octave writes to stdout when the interpreter is invoked (my > first guess). > > I suspect that the options that need to be offered on the #+begin_src > line have changed somehow since that worg page was last updated at the > end of April of this year, but don't really know. > > Help! > -Ethan