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: Fri, 17 May 2013 14:39:54 -0600 Message-ID: <87li7dibmt.fsf@gmail.com> References: <87k3ncxeqt.fsf@gmail.com> <871u9isl4x.fsf@gmail.com> <87sj1xocz7.fsf@gmail.com> <87ehdapncr.fsf@gmail.com> <87mwrtk5xa.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdRRt-0000DV-6U for emacs-orgmode@gnu.org; Fri, 17 May 2013 16:40:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdRRn-00044N-Vk for emacs-orgmode@gnu.org; Fri, 17 May 2013 16:40:21 -0400 Received: from mail-da0-x22a.google.com ([2607:f8b0:400e:c00::22a]:51033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdRRn-00044E-OK for emacs-orgmode@gnu.org; Fri, 17 May 2013 16:40:15 -0400 Received: by mail-da0-f42.google.com with SMTP id r6so1311473dad.29 for ; Fri, 17 May 2013 13:40:14 -0700 (PDT) In-Reply-To: (Paul Stansell's message of "Fri, 17 May 2013 21:18:14 +0100") 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, Eric Schulte --=-=-= Content-Type: text/plain Paul Stansell writes: > Hi Eric, > > Thanks for your work on this. I've tried your latest changes and I > think they're a big improvement. > > I've attached another org-mode file for you to try. It illustrates > the use of double blank lines in the first table (called block_data) > to inform gnuplot that there're two separate data sets in the single > data file. The first code block (gnuplot_1) plots these two data sets > as red and green surfaces. It's really nice that gnuplot can now be > used in this way from within org-mode. > > One slight drawback, however, is that there still doesn't seem to be a > way to specify missing values in the org table in the way they're > frequently used by gnuplot. An illustration of what I mean by this is > given in the table block_data_missing in the attached org file. > You'll see that I've inserted two '?' characters for missing z-values. > If you execute the second and third code blocks (gnuplot_2 and > gnuplot_3) you'll see that neither give the desired result. > I see, I've change the `org-babel-gnuplot-quote-tsv-field' function so that it will only wrap a value in double quotes if that value actually needs these wraps (e.g., contains a quote or a space). With this change your example 3 now works as expected (nice looking plots by the way). --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=gnuplot3.org #+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 | #+name: gnuplot_3 #+begin_src gnuplot :var d=block_data_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 --=-=-= Content-Type: text/plain Are there any use cases which are still not addressed? > > If the block_data_missing table were exported exactly as it is except > for the removal of the '|' characters and "set datafile missing '?'" > were specified in the gnuplot script this would enable gnuplot to plot > the red and green surfaces with the missing values. To see this try > executing the last code block (gnuplot_4) which plots the data which > is first "cleaned" by the shell command you suggested in a previous > post. This would also remove the need to have the :missing header > argument. > > Kind regards, > > Paul > -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--