From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Stansell Subject: Re: using gnuplot's "splot" and "every" commands on org-mode table data Date: Wed, 8 May 2013 16:48:49 +0100 Message-ID: References: <87k3ncxeqt.fsf@gmail.com> <871u9isl4x.fsf@gmail.com> <87sj1xocz7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua6wX-0008PI-0O for emacs-orgmode@gnu.org; Wed, 08 May 2013 12:10:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ua6bq-0003Dc-So for emacs-orgmode@gnu.org; Wed, 08 May 2013 11:49:00 -0400 Received: from mail-ia0-x233.google.com ([2607:f8b0:4001:c02::233]:37584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua6bq-0003DU-JV for emacs-orgmode@gnu.org; Wed, 08 May 2013 11:48:50 -0400 Received: by mail-ia0-f179.google.com with SMTP id g4so2055283iae.24 for ; Wed, 08 May 2013 08:48:50 -0700 (PDT) In-Reply-To: <87sj1xocz7.fsf@gmail.com> 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: Eric Schulte Cc: emacs-orgmode@gnu.org Hi Eric, In your last example are you illustrating the case of a data file with missing data? Replacing ""s with blank space in your example doesn't really break the plot, it's just that gnuplot interprets the first column of data as 1 2 3 16 6 7 4 9 and the second as 2 4 8 16 8 4 2 Gnuplot has a specific setting for handling missing values. It's common in gnuplot to use '?' to signify a missing value (type "help missing" at the gnuplot prompt). If, in your last example, you replace the missing values with '?' (without the quotes) and then type in gnuplot set datafile missing "?" and then plot the data with plot "data.txt" u 0:1, '' u 0:2 you'll see that gnuplot handles it properly. Putting '?' in the blanks cells of the org mode table in your last attachment and plotting from within org mode gives a temporary data file containing '"?"', which gnuplot also handles correctly as it must recognise "?" (with the quotes) as being a missing value. But org mode's behaviour of inserting "" in blank cells (instead of actual blanks) does break the use of "every" in gnuplot which is required by splot when plotting surfaces from data files (unless the data files are in "matrix" format). Also, inserting "" breaks the use of gnuplot's "index" which expects two blank lines to separate data sets in a single file, but I've never used this facility. I noticed that org mode writes table values of 'nan' and 'NaN' without the double quotes, but, for example, 'MaM' is written with double quotes, (as ''"MaM"') in the temporary data file. Also, I think it's generally better to remove the double quotes from around all strings exported by org mode for plotting by gnuplot as they're generally not needed (exceptions are strings which contain spaces which can be quoted so they are treated as a single entity by gnuplot). For example, there is a gnuplot demonstration script called datastrings.dem which plots data from a file called ctg-y2.dat. This data file has unquoted month names in the first column that are plotted as labels on the x-axis. Paul