From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: using gnuplot's "splot" and "every" commands on org-mode table data Date: Thu, 9 May 2013 13:54:56 +0100 Message-ID: <87zjw4xqhr.fsf@ucl.ac.uk> References: <87k3ncxeqt.fsf@gmail.com> <87r4hkuebb.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaQNO-000749-Uh for emacs-orgmode@gnu.org; Thu, 09 May 2013 08:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaQNJ-0008R3-VT for emacs-orgmode@gnu.org; Thu, 09 May 2013 08:55:14 -0400 Received: from mail-db8lp0187.outbound.messaging.microsoft.com ([213.199.154.187]:37835 helo=db8outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaQNJ-0008QI-ND for emacs-orgmode@gnu.org; Thu, 09 May 2013 08:55:09 -0400 In-Reply-To: <87r4hkuebb.fsf@Rainer.invalid> (Achim Gratz's message of "Mon, 6 May 2013 20:57:12 +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: Achim Gratz Cc: emacs-orgmode@gnu.org Achim Gratz writes: > Eric Schulte writes: >> If you really wanted to be fancy, gnuplot will let you specify shell >> transformations as part of the plotting command which would allow you to >> forego the intermediate code block. > > As a side-note, if we'd drop the convention that the first separator > defines the heading of the table and introduced a proper heading > separator, then the following would be a table that Babel languages > could interpret more easily: > > | a | b | c | > |~~~+~~~+~~~~| > | 1 | 1 | 2 | > | 1 | 2 | 5 | > | 1 | 3 | 10 | > |---+---+----| > | 2 | 1 | 5 | > | 2 | 2 | 8 | > | 2 | 3 | 13 | > |---+---+----| > | 3 | 1 | 10 | > | 3 | 2 | 13 | > | 3 | 3 | 18 | > > > Regards, > Achim. I would like to second this and actually possibly generalise the idea a little further. One of the problems with org tables, at the moment, is that the line separators have two distinct functions: 1. they are used for presentation, both within org mode and for export 2. they provide key points for cell references in calculations The two functions often coincide but not always. For instance, the following table is a reduced extract from a recent paper I wrote: #+begin_src org * Example table with multiple lines | | Strategy | Average performance | |---+----------+---------------------| | / | | 8.69 | | / | | 9.72 | | / | | 9.03 | |---+----------+---------------------| | | 1 | 9.15 | |---+----------+---------------------| | / | | 9.15 | | / | | 7.60 | | / | | 7.46 | |---+----------+---------------------| | | 2 | 8.07 | |---+----------+---------------------| #+TBLFM: @5$3=vmean(@-I..@-II);%.2f::@9$3=vmean(@-I..@-II);%.2f #+end_src The (text) export consists of a three line table with lines separating every line and one at the bottom as well: Strategy Average performance ------------------------------- 1 9.15 ------------------------------- 2 8.07 ------------------------------- Interesting aside: the export has only three lines whereas the original table had 5 so the exporter is doing some intelligent work here! Nevertheless, what I would like as the output would be Strategy Average performance ------------------------------- 1 9.15 2 8.07 Unfortunately, because of the use of line separators to make calculations easier to define, the exported table has more lines than I would want. At present, there is no mechanism for selective deletion of these line separators upon export (that I know of: I would be happy to be corrected on this!). For the paper I submitted last week for publication, the only post-org editing I had to do was delete a number \hline specifications in the exported LaTeX file. Not a major problem, obviously, but it would be nice to not have to do even that! Maybe there is a need for three different line separators: ~ for headers (to be used as Achim indicates above but possibly helpful for exporters as well), = for lines that should appear in exported output and - for those that will not appear. Header lines would typically export as well. All three would be used for formula definitions (i.e. @I references) but would solely differ in how they are processed by the exporters. For upwards compatibility, should that be desired, the meaning of = and - in the previous paragraph could be exchanged but would not be as visually appealing (in my opinion). Anyway, I will stop ruminating here and will get back to work... Thanks, eric -- : Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D : in Emacs 24.3.50.1 and Org release_8.0.2-68-g40635b