emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Time-Event-Diagrams
@ 2016-12-05 16:36 Karl Voit
  2016-12-06 17:00 ` Time-Event-Diagrams Thierry Banel
  2016-12-06 17:09 ` Time-Event-Diagrams Thierry Banel
  0 siblings, 2 replies; 8+ messages in thread
From: Karl Voit @ 2016-12-05 16:36 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

I am using following template to generate boxplot diagrams from 
values within an org-mode table:

    #+NAME: boxplot-$1
    #+BEGIN_SRC R :var data=${2:orgtable} :exports code :results none
    pdf('~/tmp/2del/boxplot-$1.pdf')
    
    boxplot(data\$${3:column},
        names=c("${4:column description}"),
        xlab="${5:x-axis}",
        ylab="${6:y-axis}",
        pars = list(boxwex = 0.3, staplewex = 0.5,
        boxfill="lightblue"))
    #+END_SRC
    
    [[file:~/tmp/2del/boxplot-$1.pdf]]

Do you have an idea, how I am able to generate a one- or 
two-dimensional diagram where I can visualize date/time-events?

The date/time events should be used from a table such as:

      | When             | How many |
      |------------------+----------|
      | [2016-11-17 Thu] |        3 |
      | [2016-11-23 Wed] |        4 |
      | [2016-12-10 Sat] |        1 |

Something like:

      Events |
             |             x
             |  x          x
             |  x          x
             |  x          x                 x
             +-------------------------------------> t
              17 Nov     23 Nov            10 Dec

... and/or 2-dimensional with only one event per date: missing second 
column of the table above.

Important: the x-position of each event (or bar) has to be relative
to its date/time: between 17 Nov and 23 Nov there is less space than 
between 23 Nov and 10 Dec.

I am open for R, Python or any JavaScript-foo I am able to use 
in a web browser.

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: Time-Event-Diagrams
  2016-12-05 16:36 Time-Event-Diagrams Karl Voit
@ 2016-12-06 17:00 ` Thierry Banel
  2016-12-06 17:54   ` Time-Event-Diagrams Karl Voit
       [not found]   ` <6ed50384ee6547f0b50a548500aed8a7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  2016-12-06 17:09 ` Time-Event-Diagrams Thierry Banel
  1 sibling, 2 replies; 8+ messages in thread
From: Thierry Banel @ 2016-12-06 17:00 UTC (permalink / raw)
  To: emacs-orgmode

What about GnuPlot?

#+plot: ind:1 deps:(2) type:2d with:"impulse lw 6" set:"yrange [0:]"
| When             | How many |
|------------------+----------|
| [2016-11-17 Thu] |        3 |
| [2016-11-23 Wed] |        4 |
| [2016-12-10 Sat] |        1 |


Type
   org-plot/gnuplot
or
   C-c " g
in the table


Le 05/12/2016 17:36, Karl Voit a écrit :
> Hi!
>
> I am using following template to generate boxplot diagrams from 
> values within an org-mode table:
>
>     #+NAME: boxplot-$1
>     #+BEGIN_SRC R :var data=${2:orgtable} :exports code :results none
>     pdf('~/tmp/2del/boxplot-$1.pdf')
>     
>     boxplot(data\$${3:column},
>         names=c("${4:column description}"),
>         xlab="${5:x-axis}",
>         ylab="${6:y-axis}",
>         pars = list(boxwex = 0.3, staplewex = 0.5,
>         boxfill="lightblue"))
>     #+END_SRC
>     
>     [[file:~/tmp/2del/boxplot-$1.pdf]]
>
> Do you have an idea, how I am able to generate a one- or 
> two-dimensional diagram where I can visualize date/time-events?
>
> The date/time events should be used from a table such as:
>
>       | When             | How many |
>       |------------------+----------|
>       | [2016-11-17 Thu] |        3 |
>       | [2016-11-23 Wed] |        4 |
>       | [2016-12-10 Sat] |        1 |
>
> Something like:
>
>       Events |
>              |             x
>              |  x          x
>              |  x          x
>              |  x          x                 x
>              +-------------------------------------> t
>               17 Nov     23 Nov            10 Dec
>
> ... and/or 2-dimensional with only one event per date: missing second 
> column of the table above.
>
> Important: the x-position of each event (or bar) has to be relative
> to its date/time: between 17 Nov and 23 Nov there is less space than 
> between 23 Nov and 10 Dec.
>
> I am open for R, Python or any JavaScript-foo I am able to use 
> in a web browser.
>

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

* Re: Time-Event-Diagrams
  2016-12-05 16:36 Time-Event-Diagrams Karl Voit
  2016-12-06 17:00 ` Time-Event-Diagrams Thierry Banel
@ 2016-12-06 17:09 ` Thierry Banel
  2017-08-29  9:22   ` Time-Event-Diagrams Colin Baxter
  1 sibling, 1 reply; 8+ messages in thread
From: Thierry Banel @ 2016-12-06 17:09 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/html, Size: 3169 bytes --]

[-- Attachment #2: whenfile.svg --]
[-- Type: image/svg+xml, Size: 10052 bytes --]

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

* Re: Time-Event-Diagrams
  2016-12-06 17:00 ` Time-Event-Diagrams Thierry Banel
@ 2016-12-06 17:54   ` Karl Voit
  2016-12-06 21:19     ` Time-Event-Diagrams Thierry Banel
       [not found]   ` <6ed50384ee6547f0b50a548500aed8a7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  1 sibling, 1 reply; 8+ messages in thread
From: Karl Voit @ 2016-12-06 17:54 UTC (permalink / raw)
  To: emacs-orgmode

* Thierry Banel <tbanelwebmin@free.fr> wrote:
> What about GnuPlot?

Heard about it. Never used.

> #+plot: ind:1 deps:(2) type:2d with:"impulse lw 6" set:"yrange [0:]"
>| When             | How many |
>|------------------+----------|
>| [2016-11-17 Thu] |        3 |
>| [2016-11-23 Wed] |        4 |
>| [2016-12-10 Sat] |        1 |

Cryptic syntax IMO.

I guess I need weeks of learning basics in order to understand GnuPlot so that
I am able to derive those plot-lines all by myself?

> Type
>    org-plot/gnuplot
> or
>    C-c " g
> in the table

Then I get «Starting gnuplot plotting program...Done» in my
mini-buffer.

That's it.

I recognized that a *gnuplot* buffer was created in background. Its
content is ...

,----
| Terminal type set to 'unknown'
| gnuplot> reset
| gnuplot> set yrange [0:]
| gnuplot> set datafile separator "\t"
| gnuplot> set xdata time
| gnuplot> set timefmt "%Y-%m-%d-%H:%M:%S"
| gnuplot> plot '/tmp/org-plot11956t0A' using 1:2 with impulse lw 6 title 'How many'
| gnuplot>
`----

... which I do not understand yet.

Since you just mentioned invoking org-plot/gnuplot, I guess there
should be any result somewhere somehow which did not work at my
side.

I could not locate any file or directory /tmp/org-plot11956t0A.

What *should* happen?

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: Time-Event-Diagrams
  2016-12-06 17:54   ` Time-Event-Diagrams Karl Voit
@ 2016-12-06 21:19     ` Thierry Banel
  0 siblings, 0 replies; 8+ messages in thread
From: Thierry Banel @ 2016-12-06 21:19 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/html, Size: 8451 bytes --]

[-- Attachment #2: bahiaahg.png --]
[-- Type: image/png, Size: 10572 bytes --]

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

* Re: Time-Event-Diagrams
       [not found]   ` <6ed50384ee6547f0b50a548500aed8a7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2016-12-07  9:39     ` Eric S Fraga
  0 siblings, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2016-12-07  9:39 UTC (permalink / raw)
  To: Karl Voit; +Cc: Karl Voit, emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

On Tuesday,  6 Dec 2016 at 17:54, Karl Voit wrote:

[...]

> Since you just mentioned invoking org-plot/gnuplot, I guess there
> should be any result somewhere somehow which did not work at my
> side.
>
> I could not locate any file or directory /tmp/org-plot11956t0A.

By default, the table plotting shows the plot in a window.  If you want
to save the plot to a file, add something along the lines of

  file:"myplot.png"

to the #+PLOT line.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.1-99-gd65aa3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: Time-Event-Diagrams
  2016-12-06 17:09 ` Time-Event-Diagrams Thierry Banel
@ 2017-08-29  9:22   ` Colin Baxter
  0 siblings, 0 replies; 8+ messages in thread
From: Colin Baxter @ 2017-08-29  9:22 UTC (permalink / raw)
  To: Thierry Banel; +Cc: emacs-orgmode

>>>>> Begin Thierry Banel <tbanelwebmin@free.fr> writes:

Or with babel-gnuplot?
The result is an SVG file that a web browser can display.

#+name: whentable
| When             | How many |
|------------------+----------|
| [2016-11-17 Thu] |        3 |
| [2016-11-23 Wed] |        4 |
| [2016-12-10 Sat] |        1 |
#+BEGIN_SRC gnuplot :file whenfile.svg :var data=whentable :session none :term svg
size 600,200
set timefmt "%Y-%m-%d-%H:%M:%S"
set xdata time
set yrange [0:]
plot data using 1:2 w impulse lw 6
#+END_SRC

#+RESULTS:
[[file:whenfile.svg]]

>>>>> End Thierry Banel <tbanelwebmin@free.fr> writes:

This no longer appears to work. The file whenfile.svg is created but is empty.

Best wishes,

-- 
--
Colin Baxter
m43cap@yandex.com
GnuPG fingerprint: 68A8 799C 0230 16E7 BF68  2A27 BBFA 2492 91F5 41C8

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

* Re: Time-Event-Diagrams
       [not found] <mailman.105.1504022416.13313.emacs-orgmode@gnu.org>
@ 2017-09-04 18:10 ` edgar
  0 siblings, 0 replies; 8+ messages in thread
From: edgar @ 2017-09-04 18:10 UTC (permalink / raw)
  To: emacs-orgmode

Message: 7
> Date: Tue, 29 Aug 2017 10:22:01 +0100
> Subject: Re: [O] Time-Event-Diagrams
> Message-ID: <874lsq4tl2.fsf@yandex.com>
> 
> 
> #+name: whentable
> | When             | How many |
> |------------------+----------|
> | [2016-11-17 Thu] |        3 |
> | [2016-11-23 Wed] |        4 |
> | [2016-12-10 Sat] |        1 |
> #+BEGIN_SRC gnuplot :file whenfile.svg :var data=whentable :session 
> none :term svg
> size 600,200
> set timefmt "%Y-%m-%d-%H:%M:%S"
> set xdata time
> set yrange [0:]
> plot data using 1:2 w impulse lw 6
> #+END_SRC
> 
> #+RESULTS:
> [[file:whenfile.svg]]
> 

> 
> This no longer appears to work. The file whenfile.svg is created but is 
> empty.
> 

It works for me if I remove the =:session none=. It seems that there are 
some issues with the session flag:

On 2017-09-03 12:23, Nicolas Goaziou wrote:
>> * Question:
>>   1. Is this the expected behaviour?
>>   2. Is there a way to get ~#+RESULTS:~ with C-c C-c directly for this 
>> kind of blocks?
> 
> I don't think so. It looks like a bug with sessions.

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

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

end of thread, other threads:[~2017-09-04 18:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.105.1504022416.13313.emacs-orgmode@gnu.org>
2017-09-04 18:10 ` Time-Event-Diagrams edgar
2016-12-05 16:36 Time-Event-Diagrams Karl Voit
2016-12-06 17:00 ` Time-Event-Diagrams Thierry Banel
2016-12-06 17:54   ` Time-Event-Diagrams Karl Voit
2016-12-06 21:19     ` Time-Event-Diagrams Thierry Banel
     [not found]   ` <6ed50384ee6547f0b50a548500aed8a7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-12-07  9:39     ` Time-Event-Diagrams Eric S Fraga
2016-12-06 17:09 ` Time-Event-Diagrams Thierry Banel
2017-08-29  9:22   ` Time-Event-Diagrams Colin Baxter

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).