emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] org-plotting with date as the independent variable


From: Eric Schulte
Subject: Re: [Orgmode] org-plotting with date as the independent variable
Date: Tue, 07 Jul 2009 12:25:42 -0700
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.92 (darwin)

"David O'Toole" <address@hidden> writes:

> I'm having trouble with org-plotting data that is captured on certain dates 
> over time, like my bodyweight. My table looks like this,
> but the plotting seems to be very wrong:
>
> #+PLOT: ind:1 timefmt:"%Y-%m-%d" with:points
> |       Date | Weight |
> |------------+--------|
> | 2008-09-26 |    266 |
> | 2008-10-08 |    261 |
> | 2008-10-16 |    263 |
> | 2008-10-19 |    259 |
> | 2009-05-20 |    272 |
> | 2009-06-12 |    274 |
> | 2009-06-23 |    275 |
>
> I've attached the incorrect image.
>

Hi David,

You've uncovered a problem with org-plot.  I'm attaching a small patch[1]
which will fix this issue.  Once that patch is applied you can plot
dates with the following org-plot options.

#+PLOT: timeind:1 timefmt:"%Y-%m-%d"
|       Date | Weight |
|------------+--------|
| 2008-09-26 |    266 |
| 2008-10-08 |    261 |
| 2008-10-16 |    263 |
| 2008-10-19 |    259 |
| 2009-05-20 |    272 |
| 2009-06-12 |    274 |
| 2009-06-23 |    275 |

Thanks for catching this bug.

>
> Also how can I plot the totals from a bunch of separate tables as the 
> dependent variable? Each of the tables would be like the
> following below:
>
> | Time | Description            | Calories |
> |------+------------------------+----------|
> | 6:00 | Whey shake, 2 scoops   |      200 |
> |      | + 2 cups skim milk     |      180 |
> | 9:30 | 4 egg whites           |      120 |
> |      | + 2 slices salami      |      200 |
> |      | + 1 slice cheese       |      110 |
> |      | Whey shake, 2 scoops   |      200 |
> |      | + 2 cups skim milk     |      180 |
> |      | light yogurt           |       60 |
> |      | rice cake              |       40 |
> |      | + 2 tbsp peanut butter |      200 |
> |------+------------------------+----------|
> |      | TOTAL                  |     1490 |
> #+TBLFM: @12$3=vsum(@address@hidden)
>
>    
>
>

I believe org-mode does support referencing cells in other tables (if
the other table is named), however I don't know of a way to reference
multiple tables.  Maybe if you could package the totals into properties
of headlines then you could use something like column view, or
org-collector[2].

Best -- Eric

>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Footnotes: 
[1]  

diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index 78775a0..aee4656 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -64,6 +64,7 @@ Returns the resulting property list."
                  ("file"    . :file)
                  ("labels"  . :labels)
                  ("map"     . :map)
+                  ("timeind" . :timeind)
                  ("timefmt" . :timefmt)))
            (multiples '("set" "line"))
            (regexp ":\\([\"][^\"]+?[\"]\\|[(][^)]+?[)]\\|[^ \t\n\r;,.]*\\)")

[2]  http://orgmode.org/worg/org-contrib/org-collector.php


reply via email to

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