emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Plotting date on xaxis


From: Johan Ekh
Subject: Re: [Orgmode] Plotting date on xaxis
Date: Tue, 23 Feb 2010 17:27:13 +0100

Thanks guys,
the babel version worked perfect so I didn't try the other one thanks!
Would it be possible to use python and matplotlib with babel instead of gnuplot?
If so, could you just indicate how such a src code block would look like?

Babel seems super cool!

/Johan

On Tue, Feb 23, 2010 at 3:47 PM, Eric Schulte <address@hidden> wrote:
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="">  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 <address@hidden> writes:

> Hi all,
> I try to plot a table looking like this
>
>      |       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-29 | 92.0 |
>      |                  |        |
>
> with the dates on the xaxis using
>
> #+PLOT: title:"Weight" ind:1 deps:(2) type:2d with:linespo set:"xdata time" timefmt:%Y-%m-%d
> set:"yrange [90:]"
>
> but no plot is generated. If I remove <set:"xdata time">, the plot is generated 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


reply via email to

[Prev in Thread] Current Thread [Next in Thread]