From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Org-babel results preamble Date: Tue, 02 Aug 2011 11:09:29 -0600 Message-ID: <87fwljwxiu.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoITG-0001RY-N3 for emacs-orgmode@gnu.org; Tue, 02 Aug 2011 13:09:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoITF-0003pO-8S for emacs-orgmode@gnu.org; Tue, 02 Aug 2011 13:09:34 -0400 Received: from mail-vx0-f169.google.com ([209.85.220.169]:34008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoITF-0003pK-69 for emacs-orgmode@gnu.org; Tue, 02 Aug 2011 13:09:33 -0400 Received: by vxg38 with SMTP id 38so6757998vxg.0 for ; Tue, 02 Aug 2011 10:09:32 -0700 (PDT) In-Reply-To: (Derek Thomas's message of "Sat, 30 Jul 2011 09:02:58 -0500") 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: Derek Thomas Cc: emacs-orgmode@gnu.org Hi Derek, If you name your code block, then it should be possible to update results without any need to replace the lines preceding the results. For example, #+source: disk-usage #+begin_src sh df #+end_src #+PLOT: title:"Disk Usage" ind:6 deps:(5) type:2d with:histograms set:"yrange [0:100]" #+results: disk-usage | Filesystem | 1K-blocks | Used | Available | Use% | Mounted | on | | /dev/sda6 | 28835836 | 8447712 | 18923344 | 31% | / | | | none | 2997072 | 676 | 2996396 | 1% | /dev | | | none | 3006056 | 0 | 3006056 | 0% | /dev/shm | | | none | 3006056 | 96 | 3005960 | 1% | /var/run | | | none | 3006056 | 0 | 3006056 | 0% | /var/lock | | | /dev/sda7 | 144176824 | 72225604 | 64627420 | 53% | /home | | Derek Thomas writes: > I have found that using org-plot to plot the results output of an > org-babel code block is very useful in prototyping my code. One minor > annoyance is the need to remove and replace the #+PLOT: header at the > beginning of the results output. Is it possible to specify a > "preamble" in the source block? I am looking to produce something > like this: > > #+begin_src sh :results wrap > ./dtest > #+end_src > #+PLOT: ind:1 deps:(2) > #+results: > #+BEGIN_RESULT > | 0.000000000000000E+000 | 1.0 | > | 9.999999776482582E-003 | 0.990000000223517 | > | 1.999999955296516E-002 | 0.980000000447035 | > | 2.999999932944775E-002 | 0.970000000670552 | > | 3.999999910593033E-002 | 0.96000000089407 | > | 4.999999888241291E-002 | 0.950000001117587 | > #+END_RESULT > Thanks, > > Derek > -- Eric Schulte http://cs.unm.edu/~eschulte/