* Plotting a table of date+time pairs
@ 2024-11-28 1:21 Michael Heerdegen
2024-11-28 9:27 ` Fraga, Eric
0 siblings, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2024-11-28 1:21 UTC (permalink / raw)
To: emacs-orgmode
Hi,
I want to plot two columns of an org table: the first column (the "x"
coordinate) consists of dates, the second column contains a time value
associated with each date.
It seems this is not as easy to do as I had hoped: AFAIU, for making
gnuplot interpret the "y"-value (!) as a time value I need to add
something like
using "1:(timecolumn(2,\"%H:%M\"))"
to the gnuplot command line (it took me quite a while to find out how to
do it at all...)
And AFAIK this is only possible by tweaking
`org-plot/preset-plot-types'. I need to add a complete new type of
plot!
Is there maybe a simpler way (I know I could add redundant columns to
the table to help org - that's not really what I want, though)?
TIA,
Michael.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Plotting a table of date+time pairs
2024-11-28 1:21 Plotting a table of date+time pairs Michael Heerdegen
@ 2024-11-28 9:27 ` Fraga, Eric
2024-11-28 23:17 ` Michael Heerdegen
0 siblings, 1 reply; 7+ messages in thread
From: Fraga, Eric @ 2024-11-28 9:27 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: emacs-orgmode@gnu.org
Response below/inline for email Michael Heerdegen wrote:
> (original email sent 28 Nov 2024 at 02:21)
>
> [...]
> And AFAIK this is only possible by tweaking
> `org-plot/preset-plot-types'. I need to add a complete new type of
> plot!
You could use a gnuplot src block instead of org-plot? It's what I do
usually as org-plot is not powerful enough for most of my plots
(although very nice for simple x-y graphs etc.).
--
: Eric S Fraga, with org 9.7.15-a1df10 in Emacs 31.0.50
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Plotting a table of date+time pairs
2024-11-28 9:27 ` Fraga, Eric
@ 2024-11-28 23:17 ` Michael Heerdegen
2024-11-29 9:30 ` Fraga, Eric
2024-11-29 15:21 ` Max Nikulin
0 siblings, 2 replies; 7+ messages in thread
From: Michael Heerdegen @ 2024-11-28 23:17 UTC (permalink / raw)
To: emacs-orgmode
"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
> You could use a gnuplot src block instead of org-plot? It's what I do
> usually as org-plot is not powerful enough for most of my plots
> (although very nice for simple x-y graphs etc.).
Ah ok, thank you. Sounds reasonable.
I'm not a sophisticated org user. May I ask for a simple example,
and how I would have to invoke gnuplot instead?
Thank you very much,
Michael.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Plotting a table of date+time pairs
2024-11-28 23:17 ` Michael Heerdegen
@ 2024-11-29 9:30 ` Fraga, Eric
2024-11-30 6:17 ` Michael Heerdegen
2024-11-29 15:21 ` Max Nikulin
1 sibling, 1 reply; 7+ messages in thread
From: Fraga, Eric @ 2024-11-29 9:30 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: emacs-orgmode@gnu.org
[-- Attachment #1: Type: text/plain, Size: 634 bytes --]
Response below/inline for email Michael Heerdegen wrote:
> (original email sent 29 Nov 2024 at 00:17)
>
> I'm not a sophisticated org user. May I ask for a simple example,
> and how I would have to invoke gnuplot instead?
Sure, see attached. This example has a table of data to plot (simple
example with two columns) and the gnuplot src block to create a PDF
plot. You invoke gnuplot by typing C-c C-c in the src block. You can
then view the result with C-c C-o.
Check the info manual for org, specifically
(org) Working with Source Code
HTH,
eric
--
: Eric S Fraga, with org 9.7.15-a1df10 in Emacs 31.0.50
[-- Attachment #2: test.org --]
[-- Type: application/vnd.lotus-organizer, Size: 550 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Plotting a table of date+time pairs
2024-11-29 9:30 ` Fraga, Eric
@ 2024-11-30 6:17 ` Michael Heerdegen
2024-11-30 6:48 ` Michael Heerdegen
0 siblings, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2024-11-30 6:17 UTC (permalink / raw)
To: emacs-orgmode
"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
> Sure, see attached. This example has a table of data to plot (simple
> example with two columns) and the gnuplot src block to create a PDF
> plot. You invoke gnuplot by typing C-c C-c in the src block. You can
> then view the result with C-c C-o.
> [...]
Ok... I had to (require 'ob-gnuplot), but then the example worked fine.
It took a while but I got my own table work as well, more or less (see
below).
Thank you very much!
"Max Nikulin" <manikulin@gmail.com> writes:
> <https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.html>
Very nice overview and reference, thank you very much as well.
I now have one remaining problem: my time values in the second column
contain the name of the time zone - the purpose is to flag the time as
summer or winter time. Currently I need to remove these indicators from
the table, else plotting fail, gnuplot doesn't understand the data.
Can I tell "ob-gnuplot" to export the table in a different way - how?
The time zone makes a difference when exporting since the generated
data file has a different format: the time fields including the timezone
get wrapped in quotation marks, without time zone they are exported
literally.
Thanks again,
Michael.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Plotting a table of date+time pairs
2024-11-30 6:17 ` Michael Heerdegen
@ 2024-11-30 6:48 ` Michael Heerdegen
0 siblings, 0 replies; 7+ messages in thread
From: Michael Heerdegen @ 2024-11-30 6:48 UTC (permalink / raw)
To: emacs-orgmode
Michael Heerdegen <michael_heerdegen@web.de> writes:
> I now have one remaining problem: my time values in the second column
> contain the name of the time zone - the purpose is to flag the time as
> summer or winter time. Currently I need to remove these indicators from
> the table, else plotting fail, gnuplot doesn't understand the data.
I could adjust `org-table-number-regexp' - this makes plotting succeed.
Unfortunately does "ob-gnuplot" not respect a buffer local binding of
that variable (in the org buffer containing the table). I need to
change the global binding of that variable.
Michael.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Plotting a table of date+time pairs
2024-11-28 23:17 ` Michael Heerdegen
2024-11-29 9:30 ` Fraga, Eric
@ 2024-11-29 15:21 ` Max Nikulin
1 sibling, 0 replies; 7+ messages in thread
From: Max Nikulin @ 2024-11-29 15:21 UTC (permalink / raw)
To: emacs-orgmode
On 29/11/2024 06:17, Michael Heerdegen wrote:
> I'm not a sophisticated org user. May I ask for a simple example,
> and how I would have to invoke gnuplot instead?
<https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.html>
Link to its source is incorrect, it should be
<https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-11-30 6:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-28 1:21 Plotting a table of date+time pairs Michael Heerdegen
2024-11-28 9:27 ` Fraga, Eric
2024-11-28 23:17 ` Michael Heerdegen
2024-11-29 9:30 ` Fraga, Eric
2024-11-30 6:17 ` Michael Heerdegen
2024-11-30 6:48 ` Michael Heerdegen
2024-11-29 15:21 ` Max Nikulin
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).