From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: Plotting (with gnuplot) using dates timestamps Date: Mon, 26 Mar 2012 16:59:15 +0200 Message-ID: <020AB818-EA26-43CC-B8F9-CCFD714972E1@polytechnique.org> References: <1332770878.2404.3.camel@ascraeus> <27136.1332772632@alphaville> Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCBOJ-00013P-PK for emacs-orgmode@gnu.org; Mon, 26 Mar 2012 10:59:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCBOC-0002nw-I8 for emacs-orgmode@gnu.org; Mon, 26 Mar 2012 10:59:27 -0400 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:53522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCBOC-0002nJ-CL for emacs-orgmode@gnu.org; Mon, 26 Mar 2012 10:59:20 -0400 In-Reply-To: <27136.1332772632@alphaville> 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: emacs-orgmode Mode On 26 mars 2012, at 16:37, Nick Dokos wrote: > Steven Buczkowski wrote: >=20 >> On Mon, 2012-03-26 at 15:37 +0200, Alan Schmitt wrote: >>> Hello, >>>=20 >>> I'm trying to plot the following table, but the dates part is all = wrong. Is there a way to tell gnuplot what the date format is? >>>=20 >>> #+tblname: data-table >>> | Date | HP | HC | >>> |------------------+--------+--------| >>> | [2011-08-20 Sat] | 006815 | 008399 | >>> | [2011-08-29 Mon] | 006840 | 008438 | >>> | [2011-09-11 Sun] | 006946 | 008552 | >>> | [2011-12-11 Sun] | 007805 | 009603 | >>> | [2012-03-04 Sun] | 008800 | 010826 | >>> | [2012-03-11 Sun] | 008876 | 010930 | >>> | [2012-03-25 Sun] | 009015 | 011121 | >>>=20 >>=20 >> In straight gnuplot, I would do something like the following: >>=20 >> gnuplot> set xdata time >> gnuplot> set timefmt '[%Y-%m-%d %a]' >>=20 >=20 > The "set xdata time" line is indeed what makes the difference: > without it, gnuplot doesn't know that this is a time series. > But there are some additional details: when babel prepares the > data, the data file that will be fed to gnuplot ends up like this > (not sure this is documented though): >=20 > ,---- > | 2011-08-20-00:00:00 6815 8399 > | 2011-08-29-00:00:00 6840 8438 > | 2011-09-11-00:00:00 6946 8552 > | 2011-12-11-00:00:00 7805 9603 > | 2012-03-04-00:00:00 8800 10826 > | 2012-03-11-00:00:00 8876 10930 > | 2012-03-25-00:00:00 9015 11121 > `---- Thanks a lot for all the suggestions. The part I was missing was the = preprocessing from babel. Using simply set xdata time set timefmt "%Y-%m-%d" did the trick. And yes: the gnuplot built-in help seems very complete. Thanks again, Alan=