From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Plotting date on xaxis Date: Tue, 23 Feb 2010 07:47:25 -0700 Message-ID: <87zl30c6zn.fsf@gmail.com> References: <417457b51002221031k48e2470aof86f6b6e71ea454b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjwaY-00040g-VR for emacs-orgmode@gnu.org; Tue, 23 Feb 2010 10:22:19 -0500 Received: from [140.186.70.92] (port=54429 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjwaY-00040W-03 for emacs-orgmode@gnu.org; Tue, 23 Feb 2010 10:22:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NjwaX-0000hz-96 for emacs-orgmode@gnu.org; Tue, 23 Feb 2010 10:22:18 -0500 Received: from fg-out-1718.google.com ([72.14.220.158]:27544) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NjwaX-0000hp-4F for emacs-orgmode@gnu.org; Tue, 23 Feb 2010 10:22:17 -0500 Received: by fg-out-1718.google.com with SMTP id 22so279925fge.12 for ; Tue, 23 Feb 2010 07:22:12 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Johan Ekh Cc: emacs-orgmode@gnu.org Hi Johan, You could try plotting your table using standard org-mode date formats which org-plot will understand without any need to specify a timefmt string. #+PLOT: title:"Weight" ind:1 deps:(2) type:2d with:linespo set:"xdata time"= set:"yrange [90:]" | Date | Kg | |------------------+------| | <2010-02-21 Sun> | 95.0 | | <2010-02-22 Mon> | 93.0 | | <2010-02-23 Tue> | 92.0 | | <2010-02-24 Wed> | 91.5 | | <2010-02-25 Thu> | 91.0 | | <2010-02-26 Fri> | 92.0 | Alternatively if you want more control over your plots and more direct access to gnuplot you can use org-babel to pass your table directly to gnuplot as follows. #+results: my-table | Date | Kg | |------------+------| | 2010-02-21 | 95.0 | | 2010-02-22 | 93.0 | | 2010-02-23 | 92.0 | | 2010-02-24 | 91.5 | | 2010-02-25 | 91.0 | | 2010-02-26 | 92.0 | #+begin_src gnuplot :var data=3Dmy-table set xdata time set timefmt '%Y-%m-%d' set yrange [90:] plot data using 1:2 with linespoints title 'Kg' #+end_src Best -- Eric Johan Ekh writes: > Hi all, > I try to plot a table looking like this > > =C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Date=C2=A0= =C2=A0=C2=A0 |=C2=A0=C2=A0 Kg | > =C2=A0=C2=A0=C2=A0=C2=A0 |-----------------+--------| > =C2=A0=C2=A0=C2=A0=C2=A0 | 2010-02-21 | 95.0 | > =C2=A0=C2=A0=C2=A0=C2=A0 | 2010-02-22 | 93.0 | > =C2=A0=C2=A0=C2=A0=C2=A0 | 2010-02-23 | 92.0 | > =C2=A0=C2=A0=C2=A0=C2=A0 | 2010-02-24 | 91.5 | > =C2=A0=C2=A0=C2=A0=C2=A0 | 2010-02-25 | 91.0 | > =C2=A0=C2=A0=C2=A0=C2=A0 | 2010-02-29 | 92.0 | > =C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | =C2=A0 =C2=A0= =C2=A0=C2=A0=C2=A0 | > > with the dates on the xaxis using > > #+PLOT: title:"Weight" ind:1 deps:(2) type:2d with:linespo set:"xdata tim= e" timefmt:%Y-%m-%d > set:"yrange [90:]" > > but no plot is generated. If I remove , the plot is gen= erated but without > interpreting the dates as dates. > > Can anyone see what I do wrong? > > Thanks in advance, > > Johan > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode