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: Eric Schulte
Subject: Re: [Orgmode] Plotting date on xaxis
Date: Tue, 23 Feb 2010 10:33:10 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

Dan Davison <address@hidden> writes:

> Johan Ekh <address@hidden> writes:
>
>> 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?
>
> Hi Johan,
>
> I've never used matplotlib, but here's a start. Firstly, one thing I
> notice is that org-babel-python currently doesn't like the column names
> on the table (I'll add it to our TODO list). So if we make a table like
> this, without the header:
>

One nice way to get around headers is through indexing into variable
references, so for example the following two are equivalent...

#+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 python :var data=my-table[2:-1] :results output
  print str(data)
#+end_src

#+results: my-table-nohdr
| 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 python :var data=my-table-nohdr :results output
  print str(data)
#+end_src

Best -- Eric




reply via email to

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