From mboxrd@z Thu Jan 1 00:00:00 1970 From: James TD Smith Subject: Re: graphing from org-tables Date: Fri, 25 Jul 2008 17:25:27 +0100 Message-ID: <20080725162527.GA54528@yog-sothoth.mohorovi.cc> References: <4889f6f8.29578c0a.3e24.ffff8395@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KMQ5m-0002ic-I2 for emacs-orgmode@gnu.org; Fri, 25 Jul 2008 12:24:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KMQ5k-0002gm-Pj for emacs-orgmode@gnu.org; Fri, 25 Jul 2008 12:24:30 -0400 Received: from [199.232.76.173] (port=46145 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KMQ5k-0002gW-Hw for emacs-orgmode@gnu.org; Fri, 25 Jul 2008 12:24:28 -0400 Received: from 81-86-40-42.dsl.pipex.com ([81.86.40.42]:59257 helo=yog-sothoth.mohorovi.cc) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KMQ5k-0001Xr-4R for emacs-orgmode@gnu.org; Fri, 25 Jul 2008 12:24:28 -0400 Received: from yog-sothoth.mohorovi.cc (localhost [127.0.0.1]) by yog-sothoth.mohorovi.cc (8.13.4/8.13.4) with ESMTP id m6PGPRQN023184 for ; Fri, 25 Jul 2008 17:25:27 +0100 (BST) (envelope-from ahktenzero@mohorovi.cc) Received: (from ahktenzero@localhost) by yog-sothoth.mohorovi.cc (8.13.4/8.13.4/Submit) id m6PGPRPk023183 for emacs-orgmode@gnu.org; Fri, 25 Jul 2008 17:25:27 +0100 (BST) (envelope-from ahktenzero@mohorovi.cc) Content-Disposition: inline In-Reply-To: <4889f6f8.29578c0a.3e24.ffff8395@mx.google.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode On 2008-07-25 08:53:31(-0700), Eric Schulte wrote: > > Any advice for quick graphing of a table in org-mode? > I have a setup for plotting data from tables. I'm not sure if it's exactly what you want, but yoy may find it useful. 1. Add the following to your .emacs: (defun ahkt-plot-table (script) "util function to export and plot a table using the supplied gnuplot `script'" (org-table-export) (let ((cbuf (current-buffer)) (cwin (selected-window))) (save-restriction (save-excursion (find-file script) (gnuplot-send-buffer-to-gnuplot) (bury-buffer) (bury-buffer (get-buffer "*gnuplot*")))) (and (window-live-p cwin) (select-window cwin)) (switch-to-buffer cbuf) (delete-other-windows))) 2. Create a gnuplot script which plots data from a file. 3. Add the following properties to the headline containing the table. TABLE_EXPORT_FILE TABLE_EXPORT_FORMAT orgtbl-to-generic :skip 4 :splice t :sep "\t" 4. Add an org link in the table (it must be in the table otherwise the export doesn't work) as below: [[elisp:(ahkt-plot-table "")][plot table]] I suggest you put it at the top of the table. You will then need to adjust the 'skip' parameter in the export format depending on the number of lines at the top of the table which should not be exported (hlines, more than one plotting link etc). 5. You should then be able to open the link, and get a plot of the table contents. -- |---|