emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-babel and gnuplot
@ 2010-09-08  1:29 Nick Parker
  2010-09-08  1:54 ` John Hendy
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Parker @ 2010-09-08  1:29 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 783 bytes --]

Hello,

I am attempting to generate a simple chart from gnuplot using the source of
an org-table.  When I execute the gnuplot src block I get the message
"Source block produced no output".  Does anyone have any suggestions as to
what might be the cause?  I have included a sample of what I am trying to
run:

#+tblname: sessions
| Date       |  Time | Distance |
|------------+-------+----------|
| 09/02/2010 | 15:13 |      2.5 |
| 09/01/2010 | 14:00 |      2.4 |

#+begin_src gnuplot :var data=sessions
  :file org-running.png :exports both
  set title "Running Stats"
  set auto x
  set style data histogram
  set style fill solid border -1
  set boxwidth .9
  set xlabel "Date"
  set ylabel "Time"
  plot "$data" using 1:2:3 notitle
#+end_src

Nick Parker
www.developernotes.com

[-- Attachment #1.2: Type: text/html, Size: 1150 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08  1:29 Nick Parker
@ 2010-09-08  1:54 ` John Hendy
  2010-09-08  3:12   ` Nick Parker
  0 siblings, 1 reply; 12+ messages in thread
From: John Hendy @ 2010-09-08  1:54 UTC (permalink / raw)
  To: Nick Parker; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2295 bytes --]

Hi Nick,

Maybe two things off hand (booted into OS X right now where I can't try your
code..)

1) try using straight gnuplot without going through org to verify your
commands. This helps make sure that the syntax isn't producing errors.
Another way to check this out sometimes is to C-c C-c on the code block, run
the code, and then C-x b to the *gnuplot buffer to view any error messages.
Those might prove helpful.

2) try changing your plot line to: plot data using 1:2:3 notitle

I think I ran into an issue using "$data" even though it's the gnuplot
syntax. I found org examples on the mailing list where just "data" was used
instead (no quotes) and that worked.


John

P.S. Are you trying to make a 3D graph? plot using 1:2:3 will yield a 3D
graph and you didn't mention a z-axis label so I'm wondering if that's
really what you want? You may want to split this into two graphs to have
date vs. time and date vs. distance? Or date vs. distance/time (speed)?

P.P.S Or perhaps judging by the boxwidth option you want the width of the
bars in the graph to represent the miles run? In that case you want 'plot
data using 1:2:3 with boxes notitle' I think.



On Tue, Sep 7, 2010 at 8:29 PM, Nick Parker <nickp@developernotes.com>wrote:

> Hello,
>
> I am attempting to generate a simple chart from gnuplot using the source of
> an org-table.  When I execute the gnuplot src block I get the message
> "Source block produced no output".  Does anyone have any suggestions as to
> what might be the cause?  I have included a sample of what I am trying to
> run:
>
> #+tblname: sessions
> | Date       |  Time | Distance |
> |------------+-------+----------|
> | 09/02/2010 | 15:13 |      2.5 |
> | 09/01/2010 | 14:00 |      2.4 |
>
> #+begin_src gnuplot :var data=sessions
>   :file org-running.png :exports both
>   set title "Running Stats"
>   set auto x
>   set style data histogram
>    set style fill solid border -1
>   set boxwidth .9
>   set xlabel "Date"
>   set ylabel "Time"
>   plot "$data" using 1:2:3 notitle
> #+end_src
>
> Nick Parker
> www.developernotes.com
>
> _______________________________________________
> 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
>
>

[-- Attachment #1.2: Type: text/html, Size: 3313 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08  1:54 ` John Hendy
@ 2010-09-08  3:12   ` Nick Parker
  2010-09-08  3:27     ` Erik Iverson
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Parker @ 2010-09-08  3:12 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2957 bytes --]

Hi John,

I would actually like to plot different lines per distance, each
that correlate to a date and elapsed-time (x and y axis respectively).  I
get an error with the :file notation, though I read that in a sample babel
gnuplot example for generating graphs of commit history on the org-mode git
repository.  I tried to reference the variable data without the quotes and $
sign without any success.  I will continue to fiddle with it, I am new to
gnuplot.

Nick Parker
www.developernotes.com


On Tue, Sep 7, 2010 at 8:54 PM, John Hendy <jw.hendy@gmail.com> wrote:

> Hi Nick,
>
> Maybe two things off hand (booted into OS X right now where I can't try
> your code..)
>
> 1) try using straight gnuplot without going through org to verify your
> commands. This helps make sure that the syntax isn't producing errors.
> Another way to check this out sometimes is to C-c C-c on the code block, run
> the code, and then C-x b to the *gnuplot buffer to view any error messages.
> Those might prove helpful.
>
> 2) try changing your plot line to: plot data using 1:2:3 notitle
>
> I think I ran into an issue using "$data" even though it's the gnuplot
> syntax. I found org examples on the mailing list where just "data" was used
> instead (no quotes) and that worked.
>
>
> John
>
> P.S. Are you trying to make a 3D graph? plot using 1:2:3 will yield a 3D
> graph and you didn't mention a z-axis label so I'm wondering if that's
> really what you want? You may want to split this into two graphs to have
> date vs. time and date vs. distance? Or date vs. distance/time (speed)?
>
> P.P.S Or perhaps judging by the boxwidth option you want the width of the
> bars in the graph to represent the miles run? In that case you want 'plot
> data using 1:2:3 with boxes notitle' I think.
>
>
>
> On Tue, Sep 7, 2010 at 8:29 PM, Nick Parker <nickp@developernotes.com>wrote:
>
>> Hello,
>>
>> I am attempting to generate a simple chart from gnuplot using the source
>> of an org-table.  When I execute the gnuplot src block I get the message
>> "Source block produced no output".  Does anyone have any suggestions as to
>> what might be the cause?  I have included a sample of what I am trying to
>> run:
>>
>> #+tblname: sessions
>> | Date       |  Time | Distance |
>> |------------+-------+----------|
>> | 09/02/2010 | 15:13 |      2.5 |
>> | 09/01/2010 | 14:00 |      2.4 |
>>
>> #+begin_src gnuplot :var data=sessions
>>   :file org-running.png :exports both
>>   set title "Running Stats"
>>   set auto x
>>   set style data histogram
>>    set style fill solid border -1
>>   set boxwidth .9
>>   set xlabel "Date"
>>   set ylabel "Time"
>>   plot "$data" using 1:2:3 notitle
>> #+end_src
>>
>> Nick Parker
>> www.developernotes.com
>>
>> _______________________________________________
>> 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
>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 4370 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08  3:12   ` Nick Parker
@ 2010-09-08  3:27     ` Erik Iverson
  2010-09-08 13:10       ` Nick Parker
  0 siblings, 1 reply; 12+ messages in thread
From: Erik Iverson @ 2010-09-08  3:27 UTC (permalink / raw)
  To: Nick Parker; +Cc: emacs-orgmode

On 09/07/2010 10:12 PM, Nick Parker wrote:
> Hi John,
>
> I would actually like to plot different lines per distance, each
> that correlate to a date and elapsed-time (x and y axis respectively).
>   I get an error with the :file notation, though I read that in a sample
> babel gnuplot example for generating graphs of commit history on the
> org-mode git repository.  I tried to reference the variable data without
> the quotes and $ sign without any success.  I will continue to fiddle
> with it, I am new to gnuplot.

AFAIK, you can't break source code header argument lines across
multiple lines.  Is that how you actually have it in your
org file?


>         #+begin_src gnuplot :var data=sessions
>            :file org-running.png :exports both
>            set title "Running Stats"
>            set auto x
>            set style data histogram
>            set style fill solid border -1
>            set boxwidth .9
>            set xlabel "Date"
>            set ylabel "Time"
>            plot "$data" using 1:2:3 notitle
>         #+end_src
>
>         Nick Parker
>         www.developernotes.com <http://www.developernotes.com>
>
>         _______________________________________________
>         Emacs-orgmode mailing list
>         Please use `Reply All' to send replies to the list.
>         Emacs-orgmode@gnu.org <mailto:Emacs-orgmode@gnu.org>
>         http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
>
>
>
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08  3:27     ` Erik Iverson
@ 2010-09-08 13:10       ` Nick Parker
  2010-09-08 13:38         ` John Hendy
  2010-09-08 14:39         ` John Hendy
  0 siblings, 2 replies; 12+ messages in thread
From: Nick Parker @ 2010-09-08 13:10 UTC (permalink / raw)
  To: Erik Iverson; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1900 bytes --]

Erik,

That was the issue, the :file reference needed to be on the line above.
 Thanks.

Nick Parker
www.developernotes.com


On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson <eriki@ccbr.umn.edu> wrote:

> On 09/07/2010 10:12 PM, Nick Parker wrote:
>
>> Hi John,
>>
>> I would actually like to plot different lines per distance, each
>> that correlate to a date and elapsed-time (x and y axis respectively).
>>  I get an error with the :file notation, though I read that in a sample
>> babel gnuplot example for generating graphs of commit history on the
>> org-mode git repository.  I tried to reference the variable data without
>> the quotes and $ sign without any success.  I will continue to fiddle
>> with it, I am new to gnuplot.
>>
>
> AFAIK, you can't break source code header argument lines across
> multiple lines.  Is that how you actually have it in your
> org file?
>
>
>         #+begin_src gnuplot :var data=sessions
>>           :file org-running.png :exports both
>>           set title "Running Stats"
>>           set auto x
>>           set style data histogram
>>           set style fill solid border -1
>>           set boxwidth .9
>>           set xlabel "Date"
>>           set ylabel "Time"
>>           plot "$data" using 1:2:3 notitle
>>        #+end_src
>>
>>        Nick Parker
>>        www.developernotes.com <http://www.developernotes.com>
>>
>>
>>        _______________________________________________
>>        Emacs-orgmode mailing list
>>        Please use `Reply All' to send replies to the list.
>>        Emacs-orgmode@gnu.org <mailto:Emacs-orgmode@gnu.org>
>>
>>        http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3196 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08 13:10       ` Nick Parker
@ 2010-09-08 13:38         ` John Hendy
  2010-09-08 14:39         ` John Hendy
  1 sibling, 0 replies; 12+ messages in thread
From: John Hendy @ 2010-09-08 13:38 UTC (permalink / raw)
  To: Nick Parker; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2192 bytes --]

That's great! I actually figured that was from pasting it. A lot of pasted
examples come in a bit jumbled.

Glad you're on your way!

John

On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker <nickp@developernotes.com>wrote:

> Erik,
>
> That was the issue, the :file reference needed to be on the line above.
>  Thanks.
>
>
> Nick Parker
> www.developernotes.com
>
>
> On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson <eriki@ccbr.umn.edu> wrote:
>
>> On 09/07/2010 10:12 PM, Nick Parker wrote:
>>
>>> Hi John,
>>>
>>> I would actually like to plot different lines per distance, each
>>> that correlate to a date and elapsed-time (x and y axis respectively).
>>>  I get an error with the :file notation, though I read that in a sample
>>> babel gnuplot example for generating graphs of commit history on the
>>> org-mode git repository.  I tried to reference the variable data without
>>> the quotes and $ sign without any success.  I will continue to fiddle
>>> with it, I am new to gnuplot.
>>>
>>
>> AFAIK, you can't break source code header argument lines across
>> multiple lines.  Is that how you actually have it in your
>> org file?
>>
>>
>>         #+begin_src gnuplot :var data=sessions
>>>           :file org-running.png :exports both
>>>           set title "Running Stats"
>>>           set auto x
>>>           set style data histogram
>>>           set style fill solid border -1
>>>           set boxwidth .9
>>>           set xlabel "Date"
>>>           set ylabel "Time"
>>>           plot "$data" using 1:2:3 notitle
>>>        #+end_src
>>>
>>>        Nick Parker
>>>        www.developernotes.com <http://www.developernotes.com>
>>>
>>>
>>>        _______________________________________________
>>>        Emacs-orgmode mailing list
>>>        Please use `Reply All' to send replies to the list.
>>>        Emacs-orgmode@gnu.org <mailto:Emacs-orgmode@gnu.org>
>>>
>>>        http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 3766 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08 13:10       ` Nick Parker
  2010-09-08 13:38         ` John Hendy
@ 2010-09-08 14:39         ` John Hendy
  2010-09-08 16:52           ` Nick Parker
  1 sibling, 1 reply; 12+ messages in thread
From: John Hendy @ 2010-09-08 14:39 UTC (permalink / raw)
  To: Nick Parker; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2885 bytes --]

Nick,


This got me curious to see the output. I tried to generate it on my computer
and get this in the *gnuplot* buffer after running the code:

-----
gnuplot> plot data using 1:2:3 notitle
                               ^
         warning: Skipping data file with no valid points
                                      ^
         x range is invalid
-----

This is working for you, though?

#+tblname: sessions
| Date       |  Time | Distance |
|------------+-------+----------|
| 09/02/2010 | 15:13 |      2.5 |
| 09/01/2010 | 14:00 |      2.4 |

#+begin_src gnuplot :var data=sessions :file org-running.png :exports both
  set title "Running Stats"
  set auto x
  set style data histogram
  set style fill solid border -1
  set boxwidth .9
  set xlabel "Date"
  set ylabel "Time"
  plot data using 1:2:3 notitle
#+end_src


John

On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker <nickp@developernotes.com>wrote:

> Erik,
>
> That was the issue, the :file reference needed to be on the line above.
>  Thanks.
>
>
> Nick Parker
> www.developernotes.com
>
>
> On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson <eriki@ccbr.umn.edu> wrote:
>
>> On 09/07/2010 10:12 PM, Nick Parker wrote:
>>
>>> Hi John,
>>>
>>> I would actually like to plot different lines per distance, each
>>> that correlate to a date and elapsed-time (x and y axis respectively).
>>>  I get an error with the :file notation, though I read that in a sample
>>> babel gnuplot example for generating graphs of commit history on the
>>> org-mode git repository.  I tried to reference the variable data without
>>> the quotes and $ sign without any success.  I will continue to fiddle
>>> with it, I am new to gnuplot.
>>>
>>
>> AFAIK, you can't break source code header argument lines across
>> multiple lines.  Is that how you actually have it in your
>> org file?
>>
>>
>>         #+begin_src gnuplot :var data=sessions
>>>           :file org-running.png :exports both
>>>           set title "Running Stats"
>>>           set auto x
>>>           set style data histogram
>>>           set style fill solid border -1
>>>           set boxwidth .9
>>>           set xlabel "Date"
>>>           set ylabel "Time"
>>>           plot "$data" using 1:2:3 notitle
>>>        #+end_src
>>>
>>>        Nick Parker
>>>        www.developernotes.com <http://www.developernotes.com>
>>>
>>>
>>>        _______________________________________________
>>>        Emacs-orgmode mailing list
>>>        Please use `Reply All' to send replies to the list.
>>>        Emacs-orgmode@gnu.org <mailto:Emacs-orgmode@gnu.org>
>>>
>>>        http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 4826 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08 14:39         ` John Hendy
@ 2010-09-08 16:52           ` Nick Parker
  2010-09-08 19:04             ` John Hendy
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Parker @ 2010-09-08 16:52 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 3538 bytes --]

John,

I am reworking the gnuplot script, it is not done at this point, but this is
what I currently have:

#+begin_src gnuplot :var data=sessions :file org-running.png :exports both
  set title "Running Stats"
  set xtics nomirror rotate by -45
  set key noenhanced
  set style data linespoints
  plot "$data" using 2:xtic(1) title columnheader(1), \
  for [i=2:3] '' using i title columnheader(i)
#+end_src

Nick Parker
www.developernotes.com


On Wed, Sep 8, 2010 at 9:39 AM, John Hendy <jw.hendy@gmail.com> wrote:

> Nick,
>
>
> This got me curious to see the output. I tried to generate it on my
> computer and get this in the *gnuplot* buffer after running the code:
>
> -----
> gnuplot> plot data using 1:2:3 notitle
>                                ^
>          warning: Skipping data file with no valid points
>                                       ^
>          x range is invalid
> -----
>
> This is working for you, though?
>
> #+tblname: sessions
> | Date       |  Time | Distance |
> |------------+-------+----------|
> | 09/02/2010 | 15:13 |      2.5 |
> | 09/01/2010 | 14:00 |      2.4 |
>
> #+begin_src gnuplot :var data=sessions :file org-running.png :exports both
>   set title "Running Stats"
>   set auto x
>   set style data histogram
>   set style fill solid border -1
>   set boxwidth .9
>   set xlabel "Date"
>   set ylabel "Time"
>   plot data using 1:2:3 notitle
> #+end_src
>
>
> John
>
> On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker <nickp@developernotes.com>wrote:
>
>> Erik,
>>
>> That was the issue, the :file reference needed to be on the line above.
>>  Thanks.
>>
>>
>> Nick Parker
>> www.developernotes.com
>>
>>
>> On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson <eriki@ccbr.umn.edu> wrote:
>>
>>> On 09/07/2010 10:12 PM, Nick Parker wrote:
>>>
>>>> Hi John,
>>>>
>>>> I would actually like to plot different lines per distance, each
>>>> that correlate to a date and elapsed-time (x and y axis respectively).
>>>>  I get an error with the :file notation, though I read that in a sample
>>>> babel gnuplot example for generating graphs of commit history on the
>>>> org-mode git repository.  I tried to reference the variable data without
>>>> the quotes and $ sign without any success.  I will continue to fiddle
>>>> with it, I am new to gnuplot.
>>>>
>>>
>>> AFAIK, you can't break source code header argument lines across
>>> multiple lines.  Is that how you actually have it in your
>>> org file?
>>>
>>>
>>>         #+begin_src gnuplot :var data=sessions
>>>>           :file org-running.png :exports both
>>>>           set title "Running Stats"
>>>>           set auto x
>>>>           set style data histogram
>>>>           set style fill solid border -1
>>>>           set boxwidth .9
>>>>           set xlabel "Date"
>>>>           set ylabel "Time"
>>>>           plot "$data" using 1:2:3 notitle
>>>>        #+end_src
>>>>
>>>>        Nick Parker
>>>>        www.developernotes.com <http://www.developernotes.com>
>>>>
>>>>
>>>>        _______________________________________________
>>>>        Emacs-orgmode mailing list
>>>>        Please use `Reply All' to send replies to the list.
>>>>        Emacs-orgmode@gnu.org <mailto:Emacs-orgmode@gnu.org>
>>>>
>>>>        http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>
>>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 5936 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08 16:52           ` Nick Parker
@ 2010-09-08 19:04             ` John Hendy
  2010-09-09  0:20               ` Nick Parker
  0 siblings, 1 reply; 12+ messages in thread
From: John Hendy @ 2010-09-08 19:04 UTC (permalink / raw)
  To: Nick Parker; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 6387 bytes --]

Nick,

How about this?? Just fiddled around a little and wonder what you think.
There might be a better way, but essentially, I've done the following:

- Left y-axis = distance
- Right y-axis = time
- I couldn't get the xtic(1) option to work, so I replaced things with what
I've found to work x:y:xticlabels(col#)
- Beefed up the points to make them a little easier to see
- Used your data to "calibrate" your speed
--- The left y-axis is from 9-21min
--- The right y-axis is from 1.5min - 3.5min
--- This means the axes are 'calibrated' to 10mph

What does the "calibration" do? It means that at a quick glance you can see
your speed based on a target rate you set:
- if speed/distance are on top of each other, you're right at your target
- if speed (green) is higher than distance (red), you were faster than your
target
- if speed (green) is lower than distance (red), you were slower than your
target

Resetting your target is as easy as changing (in the code below):
- Time: yrange [y1:y2]
- Distance: y2range [y3:y4]

All you have to do is make sure that y3/y1 = y4/y2 = target speed

Also, remove the references to L/R and Red/Green if you'd like from the
labels. I just tried to make the labels as easy as possible to follow so
that no matter where you looked for a reference you would be forced to see
what color/axis matched what value.

I attached a sample graph. Sorry if I overstepped my bounds -- I realize
it's *your* workout tracker. Take what you like and ditch the rest. I wanted
to know how to do two different y axes anyway so it helped me learn. Code is
here:

------------------- gnuplot code -----------------------

#+tblname: sessions
| Date        | ID |  Time | Distance |
|-------------+----+-------+----------|
| 9/1/2010    |  1 | 14:00 |      2.4 |
| 9/2/2010    |  2 | 15:13 |      2.5 |
| 9/10/2010   |  3 | 13:45 |      2.3 |
| 9/11        |  4 | 12:20 |      2.0 |
| Spd > 10mph |  5 | 16:35 |      2.8 |
| Spd = 10mph |  6 |    10 |    1.666 |
| Spd < 10mph |  7 |    20 |      2.8 |

#+begin_src gnuplot :var data=sessions :file org-running.png :exports both
  reset
  set title "Running Stats"
  set size ratio square

  set xlabel "Date"
  set xtics nomirror rotate by -45

  set yrange [9:21]
  set ylabel "Time (min) -- Red"
  set ytics nomirror

  set y2range [1.5:3.5]
  set y2label "Distance (mi) -- Green"
  set y2tics 0,0.5,3.5

  set style data points
  plot data u 2:3:xticlabels(1) axis x1y1 lw 3 title 'Time (L axis)', \
       data u 2:4 axis x2y2 lw 3 title 'Distance (R axis)'
#+end_src

------------------- end gnuplot code ---------------------


Best regards,
John

On Wed, Sep 8, 2010 at 11:52 AM, Nick Parker <nickp@developernotes.com>wrote:

> John,
>
> I am reworking the gnuplot script, it is not done at this point, but this
> is what I currently have:
>
> #+begin_src gnuplot :var data=sessions :file org-running.png :exports both
>   set title "Running Stats"
>   set xtics nomirror rotate by -45
>   set key noenhanced
>   set style data linespoints
>   plot "$data" using 2:xtic(1) title columnheader(1), \
>   for [i=2:3] '' using i title columnheader(i)
> #+end_src
>
> Nick Parker
> www.developernotes.com
>
>
> On Wed, Sep 8, 2010 at 9:39 AM, John Hendy <jw.hendy@gmail.com> wrote:
>
>> Nick,
>>
>>
>> This got me curious to see the output. I tried to generate it on my
>> computer and get this in the *gnuplot* buffer after running the code:
>>
>> -----
>> gnuplot> plot data using 1:2:3 notitle
>>                                ^
>>          warning: Skipping data file with no valid points
>>                                       ^
>>          x range is invalid
>> -----
>>
>> This is working for you, though?
>>
>> #+tblname: sessions
>> | Date       |  Time | Distance |
>> |------------+-------+----------|
>> | 09/02/2010 | 15:13 |      2.5 |
>> | 09/01/2010 | 14:00 |      2.4 |
>>
>> #+begin_src gnuplot :var data=sessions :file org-running.png :exports both
>>   set title "Running Stats"
>>   set auto x
>>   set style data histogram
>>   set style fill solid border -1
>>   set boxwidth .9
>>   set xlabel "Date"
>>   set ylabel "Time"
>>   plot data using 1:2:3 notitle
>> #+end_src
>>
>>
>> John
>>
>> On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker <nickp@developernotes.com>wrote:
>>
>>> Erik,
>>>
>>> That was the issue, the :file reference needed to be on the line above.
>>>  Thanks.
>>>
>>>
>>> Nick Parker
>>> www.developernotes.com
>>>
>>>
>>> On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson <eriki@ccbr.umn.edu>wrote:
>>>
>>>> On 09/07/2010 10:12 PM, Nick Parker wrote:
>>>>
>>>>> Hi John,
>>>>>
>>>>> I would actually like to plot different lines per distance, each
>>>>> that correlate to a date and elapsed-time (x and y axis respectively).
>>>>>  I get an error with the :file notation, though I read that in a sample
>>>>> babel gnuplot example for generating graphs of commit history on the
>>>>> org-mode git repository.  I tried to reference the variable data
>>>>> without
>>>>> the quotes and $ sign without any success.  I will continue to fiddle
>>>>> with it, I am new to gnuplot.
>>>>>
>>>>
>>>> AFAIK, you can't break source code header argument lines across
>>>> multiple lines.  Is that how you actually have it in your
>>>> org file?
>>>>
>>>>
>>>>         #+begin_src gnuplot :var data=sessions
>>>>>           :file org-running.png :exports both
>>>>>           set title "Running Stats"
>>>>>           set auto x
>>>>>           set style data histogram
>>>>>           set style fill solid border -1
>>>>>           set boxwidth .9
>>>>>           set xlabel "Date"
>>>>>           set ylabel "Time"
>>>>>           plot "$data" using 1:2:3 notitle
>>>>>        #+end_src
>>>>>
>>>>>        Nick Parker
>>>>>        www.developernotes.com <http://www.developernotes.com>
>>>>>
>>>>>
>>>>>        _______________________________________________
>>>>>        Emacs-orgmode mailing list
>>>>>        Please use `Reply All' to send replies to the list.
>>>>>        Emacs-orgmode@gnu.org <mailto:Emacs-orgmode@gnu.org>
>>>>>
>>>>>        http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>>
>>>>
>>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 9871 bytes --]

[-- Attachment #2: org-running.png --]
[-- Type: image/png, Size: 6853 bytes --]

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2010-09-08 19:04             ` John Hendy
@ 2010-09-09  0:20               ` Nick Parker
  0 siblings, 0 replies; 12+ messages in thread
From: Nick Parker @ 2010-09-09  0:20 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 6834 bytes --]

John,

Thanks for you're input, I'll give it a whirl.

Nick Parker
www.developernotes.com


On Wed, Sep 8, 2010 at 2:04 PM, John Hendy <jw.hendy@gmail.com> wrote:

> Nick,
>
> How about this?? Just fiddled around a little and wonder what you think.
> There might be a better way, but essentially, I've done the following:
>
> - Left y-axis = distance
> - Right y-axis = time
> - I couldn't get the xtic(1) option to work, so I replaced things with what
> I've found to work x:y:xticlabels(col#)
> - Beefed up the points to make them a little easier to see
> - Used your data to "calibrate" your speed
> --- The left y-axis is from 9-21min
> --- The right y-axis is from 1.5min - 3.5min
> --- This means the axes are 'calibrated' to 10mph
>
> What does the "calibration" do? It means that at a quick glance you can see
> your speed based on a target rate you set:
> - if speed/distance are on top of each other, you're right at your target
> - if speed (green) is higher than distance (red), you were faster than your
> target
> - if speed (green) is lower than distance (red), you were slower than your
> target
>
> Resetting your target is as easy as changing (in the code below):
> - Time: yrange [y1:y2]
> - Distance: y2range [y3:y4]
>
> All you have to do is make sure that y3/y1 = y4/y2 = target speed
>
> Also, remove the references to L/R and Red/Green if you'd like from the
> labels. I just tried to make the labels as easy as possible to follow so
> that no matter where you looked for a reference you would be forced to see
> what color/axis matched what value.
>
> I attached a sample graph. Sorry if I overstepped my bounds -- I realize
> it's *your* workout tracker. Take what you like and ditch the rest. I
> wanted to know how to do two different y axes anyway so it helped me learn.
> Code is here:
>
> ------------------- gnuplot code -----------------------
>
> #+tblname: sessions
> | Date        | ID |  Time | Distance |
> |-------------+----+-------+----------|
> | 9/1/2010    |  1 | 14:00 |      2.4 |
> | 9/2/2010    |  2 | 15:13 |      2.5 |
> | 9/10/2010   |  3 | 13:45 |      2.3 |
> | 9/11        |  4 | 12:20 |      2.0 |
> | Spd > 10mph |  5 | 16:35 |      2.8 |
> | Spd = 10mph |  6 |    10 |    1.666 |
> | Spd < 10mph |  7 |    20 |      2.8 |
>
> #+begin_src gnuplot :var data=sessions :file org-running.png :exports both
>   reset
>   set title "Running Stats"
>   set size ratio square
>
>   set xlabel "Date"
>   set xtics nomirror rotate by -45
>
>   set yrange [9:21]
>   set ylabel "Time (min) -- Red"
>   set ytics nomirror
>
>   set y2range [1.5:3.5]
>   set y2label "Distance (mi) -- Green"
>   set y2tics 0,0.5,3.5
>
>   set style data points
>   plot data u 2:3:xticlabels(1) axis x1y1 lw 3 title 'Time (L axis)', \
>        data u 2:4 axis x2y2 lw 3 title 'Distance (R axis)'
> #+end_src
>
> ------------------- end gnuplot code ---------------------
>
>
> Best regards,
> John
>
> On Wed, Sep 8, 2010 at 11:52 AM, Nick Parker <nickp@developernotes.com>wrote:
>
>> John,
>>
>> I am reworking the gnuplot script, it is not done at this point, but this
>> is what I currently have:
>>
>> #+begin_src gnuplot :var data=sessions :file org-running.png :exports both
>>   set title "Running Stats"
>>   set xtics nomirror rotate by -45
>>   set key noenhanced
>>   set style data linespoints
>>   plot "$data" using 2:xtic(1) title columnheader(1), \
>>   for [i=2:3] '' using i title columnheader(i)
>> #+end_src
>>
>> Nick Parker
>> www.developernotes.com
>>
>>
>> On Wed, Sep 8, 2010 at 9:39 AM, John Hendy <jw.hendy@gmail.com> wrote:
>>
>>> Nick,
>>>
>>>
>>> This got me curious to see the output. I tried to generate it on my
>>> computer and get this in the *gnuplot* buffer after running the code:
>>>
>>> -----
>>> gnuplot> plot data using 1:2:3 notitle
>>>                                ^
>>>          warning: Skipping data file with no valid points
>>>                                       ^
>>>          x range is invalid
>>> -----
>>>
>>> This is working for you, though?
>>>
>>> #+tblname: sessions
>>> | Date       |  Time | Distance |
>>> |------------+-------+----------|
>>> | 09/02/2010 | 15:13 |      2.5 |
>>> | 09/01/2010 | 14:00 |      2.4 |
>>>
>>> #+begin_src gnuplot :var data=sessions :file org-running.png :exports
>>> both
>>>   set title "Running Stats"
>>>   set auto x
>>>   set style data histogram
>>>   set style fill solid border -1
>>>   set boxwidth .9
>>>   set xlabel "Date"
>>>   set ylabel "Time"
>>>   plot data using 1:2:3 notitle
>>> #+end_src
>>>
>>>
>>> John
>>>
>>> On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker <nickp@developernotes.com>wrote:
>>>
>>>> Erik,
>>>>
>>>> That was the issue, the :file reference needed to be on the line above.
>>>>  Thanks.
>>>>
>>>>
>>>> Nick Parker
>>>> www.developernotes.com
>>>>
>>>>
>>>> On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson <eriki@ccbr.umn.edu>wrote:
>>>>
>>>>> On 09/07/2010 10:12 PM, Nick Parker wrote:
>>>>>
>>>>>> Hi John,
>>>>>>
>>>>>> I would actually like to plot different lines per distance, each
>>>>>> that correlate to a date and elapsed-time (x and y axis respectively).
>>>>>>  I get an error with the :file notation, though I read that in a
>>>>>> sample
>>>>>> babel gnuplot example for generating graphs of commit history on the
>>>>>> org-mode git repository.  I tried to reference the variable data
>>>>>> without
>>>>>> the quotes and $ sign without any success.  I will continue to fiddle
>>>>>> with it, I am new to gnuplot.
>>>>>>
>>>>>
>>>>> AFAIK, you can't break source code header argument lines across
>>>>> multiple lines.  Is that how you actually have it in your
>>>>> org file?
>>>>>
>>>>>
>>>>>         #+begin_src gnuplot :var data=sessions
>>>>>>           :file org-running.png :exports both
>>>>>>           set title "Running Stats"
>>>>>>           set auto x
>>>>>>           set style data histogram
>>>>>>           set style fill solid border -1
>>>>>>           set boxwidth .9
>>>>>>           set xlabel "Date"
>>>>>>           set ylabel "Time"
>>>>>>           plot "$data" using 1:2:3 notitle
>>>>>>        #+end_src
>>>>>>
>>>>>>        Nick Parker
>>>>>>        www.developernotes.com <http://www.developernotes.com>
>>>>>>
>>>>>>
>>>>>>        _______________________________________________
>>>>>>        Emacs-orgmode mailing list
>>>>>>        Please use `Reply All' to send replies to the list.
>>>>>>        Emacs-orgmode@gnu.org <mailto:Emacs-orgmode@gnu.org>
>>>>>>
>>>>>>        http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 10529 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* org-babel and gnuplot
@ 2013-06-07 13:25 Carlos Russo
  2013-06-07 16:48 ` Eric Schulte
  0 siblings, 1 reply; 12+ messages in thread
From: Carlos Russo @ 2013-06-07 13:25 UTC (permalink / raw)
  To: emacs-orgmode

Hi

I was trying a  gnuplot source block, and was stricken by "No org-babel-execute function for gnuplot!" when I tried to execute the block.
I made sure the variable org-babel-load-languages contained (gnuplot . t) , so I was quite puzzled.

It turns out that I needed to explicitly add 
(require 'ob-gnuplot)
to my .emacs file.

According to the documentation, this line should not be needed for org-mode 8.03 (my current version).
It this a bug in the documentation?

Cheers,
Carlos

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: org-babel and gnuplot
  2013-06-07 13:25 org-babel and gnuplot Carlos Russo
@ 2013-06-07 16:48 ` Eric Schulte
  0 siblings, 0 replies; 12+ messages in thread
From: Eric Schulte @ 2013-06-07 16:48 UTC (permalink / raw)
  To: Carlos Russo; +Cc: emacs-orgmode

Carlos Russo <carlos.russo@ist.utl.pt> writes:

> Hi
>
> I was trying a  gnuplot source block, and was stricken by "No org-babel-execute function for gnuplot!" when I tried to execute the block.
> I made sure the variable org-babel-load-languages contained (gnuplot . t) , so I was quite puzzled.
>
> It turns out that I needed to explicitly add 
> (require 'ob-gnuplot)
> to my .emacs file.
>
> According to the documentation, this line should not be needed for org-mode 8.03 (my current version).
> It this a bug in the documentation?
>
> Cheers,
> Carlos

There are instructions for enabling language in the following page of
the manual.

http://orgmode.org/manual/Languages.html#Languages

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-06-07 16:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07 13:25 org-babel and gnuplot Carlos Russo
2013-06-07 16:48 ` Eric Schulte
  -- strict thread matches above, loose matches on Subject: below --
2010-09-08  1:29 Nick Parker
2010-09-08  1:54 ` John Hendy
2010-09-08  3:12   ` Nick Parker
2010-09-08  3:27     ` Erik Iverson
2010-09-08 13:10       ` Nick Parker
2010-09-08 13:38         ` John Hendy
2010-09-08 14:39         ` John Hendy
2010-09-08 16:52           ` Nick Parker
2010-09-08 19:04             ` John Hendy
2010-09-09  0:20               ` Nick Parker

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).