From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: using gnuplot's "splot" and "every" commands on org-mode table data Date: Mon, 23 Sep 2013 17:32:50 -0600 Message-ID: <87ioxr15c0.fsf@gmail.com> References: <87k3ncxeqt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOFcd-0001uR-LX for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 19:33:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOFcY-0007wc-GR for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 19:32:55 -0400 Received: from mail-pb0-x22a.google.com ([2607:f8b0:400e:c01::22a]:65020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOFcY-0007wW-AA for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 19:32:50 -0400 Received: by mail-pb0-f42.google.com with SMTP id un15so3825297pbc.29 for ; Mon, 23 Sep 2013 16:32:49 -0700 (PDT) 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: Paul Stansell Cc: emacs-orgmode@gnu.org Paul Stansell writes: > Hi Eric, > > There appears to be a slight bug in the way gnuplot handles blocked > data with missing entries. > > An example is provided in the org script at then end of this note. > > In the code block gnuplot_1 the use of ':missing "?"' seems to cause > the exported data file to lack the blanks lines that are essential > for the plot. The plot from this code block is incorrect. > > In gnuplot_2 ':missing' is not used, but instead 'set datafile missing > "?"' is set explicitly in the gnuplot code block. The plot from this > code block is correct. > > Surely gnuplot_1 should produce exactly the same plot as gnuplot_2. > Hi Paul, Currently the :missing header argument for gnuplot code blocks does two things. It adds the "set datafile missing..." line to the code block body *and* it binds `*org-babel-gnuplot-missing*' to the value of the :missing header argument when the datafile is written, so empty table cells are replaced with the value of the :missing header argument. The reason you're not getting a blank line is because it is replaced with three "missing" values, in this case "? ? ?". Do you think this behavior should be changed or split between two header arguments? Thanks, > > Kind regards, > > Paul > > > Exported data file does not include blank lines. > #+name: gnuplot_1 > #+begin_src gnuplot :var d=block_data_missing :missing "?" :results silent > set ticslevel 0 > splot d index 0 u 1:2:3 w lp pt 6 ps 5, d index 1 u 1:2:3 w lp pt 6 ps 5 > #+end_src > > Exported data file includes blank lines. > #+name: gnuplot_2 > #+begin_src gnuplot :var d=block_data_missing :results silent > set datafile missing "?" > set ticslevel 0 > splot d index 0 u 1:2:3 w lp pt 6 ps 5, d index 1 u 1:2:3 w lp pt 6 ps 5 > #+end_src > > #+name: block_data_missing > | 1 | 1 | 2 | > | 1 | 2 | 5 | > | 1 | 3 | 10 | > | | | | > | 2 | 1 | 5 | > | 2 | 2 | 10 | > | 2 | 3 | 13 | > | | | | > | 3 | 1 | 10 | > | 3 | 2 | ? | > | 3 | 3 | 18 | > | | | | > | | | | > | 1 | 1 | 12 | > | 1 | 2 | 15 | > | 1 | 3 | 20 | > | | | | > | 2 | 1 | 15 | > | 2 | 2 | 18 | > | 2 | 3 | 23 | > | | | | > | 3 | 1 | ? | > | 3 | 2 | 23 | > | 3 | 3 | 28 | > > > > > -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D