Re: [O] Trying to get chart from table working

2017-10-05 Thread Peter Davis

On Thu, Oct 5, 2017, at 10:39 AM, Nicolas Goaziou wrote:
> Hello,
> 
> Peter Davis  writes:
> 
> > On Wed, Oct 4, 2017, at 01:36 AM, Eric S Fraga wrote:
> >> On Tuesday,  3 Oct 2017 at 15:28, Peter Davis wrote:
> >> > Yup. I deleted the source block and the results line, and now export to
> >> > HTML and PDF works with no problems.
> >> 
> >> Please post the complete file (t.org?) to this list.
> >
> > Ok. The original (t.org) is exactly what you posted a few days ago. This
> > fails to export HTML. ("Wrong type argument")
> 
> As another data point, I cannot reproduce the error with "t.org".

Thanks. It seems I have two problems:

1) Something in my emacs/org setup is causing this to fail outright,
with a "wrong type parameter" error. If I run in a shell window with no
init files, I don't get that error.

2) Something is preventing gnuplot from working. Even when I can
successfully export to HTML or PDF, I don't get any graph.

Thanks,
-pd

-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-05 Thread Nicolas Goaziou
Hello,

Peter Davis  writes:

> On Wed, Oct 4, 2017, at 01:36 AM, Eric S Fraga wrote:
>> On Tuesday,  3 Oct 2017 at 15:28, Peter Davis wrote:
>> > Yup. I deleted the source block and the results line, and now export to
>> > HTML and PDF works with no problems.
>> 
>> Please post the complete file (t.org?) to this list.
>
> Ok. The original (t.org) is exactly what you posted a few days ago. This
> fails to export HTML. ("Wrong type argument")

As another data point, I cannot reproduce the error with "t.org".

Regards,

-- 
Nicolas Goaziou



Re: [O] Trying to get chart from table working

2017-10-04 Thread Eric S Fraga
On Wednesday,  4 Oct 2017 at 09:12, Peter Davis wrote:

[...]

> Meanwhile, I have discovered a Google charting function which gives me
> an annotated time series graph that comes very close to what I
> need. Also, I’ve had no problems exporting many other documents to
> HTML and/or PDF. So I’m afraid solving this has dropped on my priority
> list.

Frustrating that you have not managed to get this working in Emacs with
org but I'm glad you found a solution to the real task.

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-04 Thread Peter Davis

> On Oct 4, 2017, at 8:48 AM, Eric S Fraga  wrote:
> 
> On Wednesday,  4 Oct 2017 at 07:49, Peter Davis wrote:
> 
> [...]
> 
>> By the way, I just re-installed Org from the package manager, so I'm now
>> at
>> 
>> Org mode version 9.1.1 (9.1.1-17-g24ea1b-elpa @
>> /Users/peterdavis/.emacs.d/elpa/org-20171002/)
>> 
>> I was hoping this would fix any possible installation inconsistency
>> problems. Is there a better way to do this?
> 
> It's not so much which version has been installed but whether you are
> picking up this version as opposed to the one built-in to Emacs.  You
> have to make sure this version is picked up when org is loaded.  Do you
> have any org related aspects in your initialisation that may be invoked
> before Emacs is told about the new version?



I tried running emacs in a shell window with no initialization file, and t.org 
 *did* export HTML, and PDF (although I *still* don’t get the 
graph).

So yes, I guess there’s something in my init file that’s messing this up.

Chances of finding it in my lifetime: near zero.

Meanwhile, I have discovered a Google charting function which gives me an 
annotated time series graph that comes very close to what I need. Also, I’ve 
had no problems exporting many other documents to HTML and/or PDF. So I’m 
afraid solving this has dropped on my priority list.

Thank you all for your help,

-pd



Re: [O] Trying to get chart from table working

2017-10-04 Thread Eric S Fraga
On Wednesday,  4 Oct 2017 at 07:49, Peter Davis wrote:

[...]

> By the way, I just re-installed Org from the package manager, so I'm now
> at
>
> Org mode version 9.1.1 (9.1.1-17-g24ea1b-elpa @
> /Users/peterdavis/.emacs.d/elpa/org-20171002/)
>
> I was hoping this would fix any possible installation inconsistency
> problems. Is there a better way to do this?

It's not so much which version has been installed but whether you are
picking up this version as opposed to the one built-in to Emacs.  You
have to make sure this version is picked up when org is loaded.  Do you
have any org related aspects in your initialisation that may be invoked
before Emacs is told about the new version?

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-87-g3c83f1


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-04 Thread Eric S Fraga
On Wednesday,  4 Oct 2017 at 07:24, Peter Davis wrote:
> Ok. The original (t.org) is exactly what you posted a few days ago. This
> fails to export HTML. ("Wrong type argument")
>
> The other file (t2.org) has the empty table cells filled in, and has the
> SRC and RESULTS blocks removed. This exports to HTML or PDF with no
> problem.

Both export to HTML with no problems for me.
-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-87-g3c83f1


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-04 Thread Peter Davis

On Wed, Oct 4, 2017, at 07:24 AM, Peter Davis wrote:
> 
> On Wed, Oct 4, 2017, at 01:36 AM, Eric S Fraga wrote:
> > On Tuesday,  3 Oct 2017 at 15:28, Peter Davis wrote:
> > > Yup. I deleted the source block and the results line, and now export to
> > > HTML and PDF works with no problems.
> > 
> > Please post the complete file (t.org?) to this list.
> 
> Ok. The original (t.org) is exactly what you posted a few days ago. This
> fails to export HTML. ("Wrong type argument")
> 
> The other file (t2.org) has the empty table cells filled in, and has the
> SRC and RESULTS blocks removed. This exports to HTML or PDF with no
> problem.
> 

By the way, I just re-installed Org from the package manager, so I'm now
at

Org mode version 9.1.1 (9.1.1-17-g24ea1b-elpa @
/Users/peterdavis/.emacs.d/elpa/org-20171002/)

I was hoping this would fix any possible installation inconsistency
problems. Is there a better way to do this?

Thanks,
-pd


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-04 Thread Peter Davis

On Wed, Oct 4, 2017, at 01:36 AM, Eric S Fraga wrote:
> On Tuesday,  3 Oct 2017 at 15:28, Peter Davis wrote:
> > Yup. I deleted the source block and the results line, and now export to
> > HTML and PDF works with no problems.
> 
> Please post the complete file (t.org?) to this list.

Ok. The original (t.org) is exactly what you posted a few days ago. This
fails to export HTML. ("Wrong type argument")

The other file (t2.org) has the empty table cells filled in, and has the
SRC and RESULTS blocks removed. This exports to HTML or PDF with no
problem.

Thanks,
-pd


-- 
  Peter Davis
  www.techcurmudgeon.com


t2.org
Description: Binary data


t.org
Description: Binary data


Re: [O] Trying to get chart from table working

2017-10-03 Thread Eric S Fraga
On Tuesday,  3 Oct 2017 at 15:28, Peter Davis wrote:
> Yup. I deleted the source block and the results line, and now export to
> HTML and PDF works with no problems.

Please post the complete file (t.org?) to this list.

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-03 Thread Peter Davis

On Tue, Oct 3, 2017, at 01:23 PM, Nick Dokos wrote:
> Peter Davis  writes:
>
> > On Tue, Oct 3, 2017, at 10:37 AM, Nick Dokos wrote:
> >>
> >> can you export *anything* to html? Or maybe export anything with
> >> a table that includes a date? The backtrace seems to implicate this> >> 
> >> latter scenario.
> >>
> >> This seems like a more generic error in the export engine and since> >> 
> >> nobody else sees it (afaik), I tend to agree with Eric F. that it
> >> might be your installation that is at fault.
> >
> > Yes, I can export to both HTML and LaTeX/PDF, including tables with> > 
> > dates, etc.  However, the document Eric sent, t.org, gives me
> > the same> > 'wrong type argument' error. I'm assuming this is due to the 
> > gnuplot> > instruction block in the document.
> >
>
> So if you delete the source block from t.org, you can export the file> with 
> no problems, correct?

Yup. I deleted the source block and the results line, and now export to
HTML and PDF works with no problems.
--
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-03 Thread Nick Dokos
Peter Davis  writes:

> On Tue, Oct 3, 2017, at 10:37 AM, Nick Dokos wrote:
>> 
>> can you export *anything* to html? Or maybe export anything with
>> a table that includes a date? The backtrace seems to implicate this
>> latter scenario.
>> 
>> This seems like a more generic error in the export engine and since
>> nobody else sees it (afaik), I tend to agree with Eric F. that it
>> might be your installation that is at fault.
>
> Yes, I can export to both HTML and LaTeX/PDF, including tables with
> dates, etc.  However, the document Eric sent, t.org, gives me the same
> 'wrong type argument' error. I'm assuming this is due to the gnuplot
> instruction block in the document.
>

So if you delete the source block from t.org, you can export the file
with no problems, correct?

-- 
Nick




Re: [O] Trying to get chart from table working

2017-10-03 Thread Peter Davis

On Tue, Oct 3, 2017, at 10:37 AM, Nick Dokos wrote:
> Peter Davis  writes:
> 
> > On Mon, Oct 2, 2017, at 11:37 AM, Eric S Fraga wrote:
> >> On Monday,  2 Oct 2017 at 10:24, Peter Davis wrote:
> >> 
> >> [...]
> >> 
> >> > I added (gnuplot . t) to my org-babel-load-languages, and now I'm back
> >> > to
> >> >
> >> > Wrong type argument: arrayp, nil
> >> 
> >> Very strange.  Try M-x toggle-debug-on-error RET and then post a
> >> backtrace?
> >
> > Attached.
> >
> >> Also maybe post your complete example.
> >
> > I'm using the same t.org file you sent a couple of days ago.
> >
> >> What versions of gnuplot and org do you have installed?
> >
> > Gnuplot says it's V5.2, patchlevel 0
> > Org version is 9.0.9
> >
> > By the way, I tried filling in a tint value in the first row, and a PSA
> > value for the middle row, but got the same error.
> >
> 
> Peter,
> 
> can you export *anything* to html? Or maybe export anything with
> a table that includes a date? The backtrace seems to implicate this
> latter scenario.
> 
> This seems like a more generic error in the export engine and since
> nobody else sees it (afaik), I tend to agree with Eric F. that it
> might be your installation that is at fault.

Yes, I can export to both HTML and LaTeX/PDF, including tables with
dates, etc.  However, the document Eric sent, t.org, gives me the same
'wrong type argument' error. I'm assuming this is due to the gnuplot
instruction block in the document.

Thank you,
-pd


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-03 Thread Nick Dokos
Peter Davis  writes:

> On Mon, Oct 2, 2017, at 11:37 AM, Eric S Fraga wrote:
>> On Monday,  2 Oct 2017 at 10:24, Peter Davis wrote:
>> 
>> [...]
>> 
>> > I added (gnuplot . t) to my org-babel-load-languages, and now I'm back
>> > to
>> >
>> > Wrong type argument: arrayp, nil
>> 
>> Very strange.  Try M-x toggle-debug-on-error RET and then post a
>> backtrace?
>
> Attached.
>
>> Also maybe post your complete example.
>
> I'm using the same t.org file you sent a couple of days ago.
>
>> What versions of gnuplot and org do you have installed?
>
> Gnuplot says it's V5.2, patchlevel 0
> Org version is 9.0.9
>
> By the way, I tried filling in a tint value in the first row, and a PSA
> value for the middle row, but got the same error.
>

Peter,

can you export *anything* to html? Or maybe export anything with
a table that includes a date? The backtrace seems to implicate this
latter scenario.

This seems like a more generic error in the export engine and since
nobody else sees it (afaik), I tend to agree with Eric F. that it
might be your installation that is at fault.

-- 
Nick




Re: [O] Trying to get chart from table working

2017-10-03 Thread Eric S Fraga
On Monday,  2 Oct 2017 at 15:39, Peter Davis wrote:
>> Very strange.  Try M-x toggle-debug-on-error RET and then post a
>> backtrace?
>
> Attached.

I cannot figure this out.  Maybe Nicolas will be able to help here.

> By the way, I tried filling in a tint value in the first row, and a PSA
> value for the middle row, but got the same error.

So it's not gnuplot, I would guess.  Could it be that you have a mixed
org installation?  Grasping at straws here...

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-87-g3c83f1


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-02 Thread Peter Davis

On Mon, Oct 2, 2017, at 11:37 AM, Eric S Fraga wrote:
> On Monday,  2 Oct 2017 at 10:24, Peter Davis wrote:
> 
> [...]
> 
> > I added (gnuplot . t) to my org-babel-load-languages, and now I'm back
> > to
> >
> > Wrong type argument: arrayp, nil
> 
> Very strange.  Try M-x toggle-debug-on-error RET and then post a
> backtrace?

Attached.

> Also maybe post your complete example.

I'm using the same t.org file you sent a couple of days ago.

> What versions of gnuplot and org do you have installed?

Gnuplot says it's V5.2, patchlevel 0
Org version is 9.0.9

By the way, I tried filling in a tint value in the first row, and a PSA
value for the middle row, but got the same error.

Thanks!
-pd

-- 
  Peter Davis
  www.techcurmudgeon.com
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  org-export-get-all-transcoders([cl-struct-org-export-backend nil org ((table 
lambda (table contents info) (concat nil contents nil)) (table-row lambda (row 
contents info) (if (eq (org-element-property :type row) (quote rule)) nil (let 
((headerp (org-export-table-row-in-header-p row info)) (lastp (not ...)) 
(last-header-p (org-export-table-row-ends-header-p row info))) (when contents 
(cond nil nil nil (t ...)) (table-cell lambda (cell contents info) (let 
((headerp (org-export-table-row-in-header-p (org-export-get-parent-element 
cell) info)) (column (1+ (cdr ... nil (when contents nil (cond nil (t (setq 
contents ... (if (or nil (plist-get info :orgtbl-ignore-sep) (not 
(org-export-get-next-element cell info))) contents (concat contents "  " 
(macro lambda (m c i) (org-element-macro-interpreter m nil))) nil nil nil nil])
  org-export-data-with-backend((table (:begin 1 :end 78 :type org :tblfm nil 
:contents-begin 1 :contents-end 78 :value nil :post-blank 0 :post-affiliated 1 
:parent (section (:begin 1 :end 78 :contents-begin 1 :contents-end 78 
:post-blank 0 :post-affiliated 1 :parent (org-data nil #2)) #0)) (table-row 
(:type standard :begin 1 :end 23 :contents-begin 2 :contents-end 22 :post-blank 
0 :post-affiliated 1 :parent #0) (table-cell (:begin 2 :end 15 :contents-begin 
3 :contents-end 13 :post-blank 0 :parent #1) #("2017-08-11" 0 10 (:parent #2))) 
(table-cell (:begin 15 :end 20 :contents-begin 15 :contents-end 18 :post-blank 
0 :parent #1) #("185" 0 3 (:parent #2))) (table-cell (:begin 20 :end 22 
:contents-begin 21 :contents-end 21 :post-blank 0 :parent #1))) (table-row 
(:type standard :begin 23 :end 49 :contents-begin 24 :contents-end 48 
:post-blank 0 :post-affiliated 23 :parent #0) (table-cell (:begin 24 :end 37 
:contents-begin 25 :contents-end 35 :post-blank 0 :parent #1) #("2017-08-21" 0 
10 (:parent #2))) (table-cell (:begin 37 :end 39 :contents-begin 38 
:contents-end 38 :post-blank 0 :parent #1)) (table-cell (:begin 39 :end 48 
:contents-begin 39 :contents-end 46 :post-blank 0 :parent #1) #("#ffdd99" 0 7 
(:parent #2 (table-row (:type standard :begin 49 :end 78 :contents-begin 50 
:contents-end 77 :post-blank 0 :post-affiliated 49 :parent #0) (table-cell 
(:begin 50 :end 63 :contents-begin 51 :contents-end 61 :post-blank 0 :parent 
#1) #("2017-09-19" 0 10 (:parent #2))) (table-cell (:begin 63 :end 68 
:contents-begin 63 :contents-end 66 :post-blank 0 :parent #1) #("854" 0 3 
(:parent #2))) (table-cell (:begin 68 :end 77 :contents-begin 68 :contents-end 
75 :post-blank 0 :parent #1) #("#ffdd99" 0 7 (:parent #2) 
[cl-struct-org-export-backend nil org ((table lambda (table contents info) 
(concat nil contents nil)) (table-row lambda (row contents info) (if (eq 
(org-element-property :type row) (quote rule)) nil (let ((headerp 
(org-export-table-row-in-header-p row info)) (lastp (not ...)) (last-header-p 
(org-export-table-row-ends-header-p row info))) (when contents (cond nil nil 
nil (t ...)) (table-cell lambda (cell contents info) (let ((headerp 
(org-export-table-row-in-header-p (org-export-get-parent-element cell) info)) 
(column (1+ (cdr ... nil (when contents nil (cond nil (t (setq contents 
... (if (or nil (plist-get info :orgtbl-ignore-sep) (not 
(org-export-get-next-element cell info))) contents (concat contents "
" (macro lambda (m c i) (org-element-macro-interpreter m nil))) nil nil nil 
nil] (:title nil :date nil :author (#("Peter Davis" 0 11 (:parent #1))) :email 
"p...@pfdstudio.com" :language "en" :select-tags ("export") :exclude-tags 
("noexport") :creator "Emacs 25.1.1 (Org mode 9.0.9)" :headline-levels 3 
:preserve-breaks nil :section-numbers t :time-stamp-file t :with-archived-trees 
headline :with-author t :with-broken-links nil :with-clocks nil :with-creator 
nil :with-date t :with-drawers (not "LOGBOOK") :with-email nil :with-emphasize 
t :with-entities t :with-fixed-width t :with-footnotes t :with-inlinetasks t 
...))
  orgtbl-to-generic((("2017-08-11" 185 "") ("2017-08-21" "" "#ffdd99") 
("2017-09-19" 854 "#ffdd99")) (:sep "" :fmt 
org-babel-gnuplot-quote-tsv-field (:var data ("2017-08-11" 185 "") 
("2017-08-21" "" 

Re: [O] Trying to get chart from table working

2017-10-02 Thread Eric S Fraga
On Monday,  2 Oct 2017 at 10:24, Peter Davis wrote:

[...]

> I added (gnuplot . t) to my org-babel-load-languages, and now I'm back
> to
>
> Wrong type argument: arrayp, nil

Very strange.  Try M-x toggle-debug-on-error RET and then post a
backtrace?
Also maybe post your complete example.
What versions of gnuplot and org do you have installed?

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-02 Thread Eric S Fraga
On Monday,  2 Oct 2017 at 11:12, Nick Dokos wrote:

[...]

> FWIW, this is what I get in the *gnuplot* buffer when I C-c C-c on the
> code block:
>
> ,
> | 
> | G N U P L O T
> | Version 5.0 patchlevel 3last modified 2016-02-21 

My gnuplot is patchlevel 7; maybe this makes a difference?  The table
does have gaps in it and maybe gnuplot has improved in how it handles
such data.

For the OP, it may be worth ensuring that all entries in the second
column have data in them...

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-02 Thread Nick Dokos
Eric S Fraga  writes:

> On Friday, 29 Sep 2017 at 17:32, Peter Davis wrote:
>> I'm sorry to belabor this, but I could use some help. I'd be willing to
>> pay a modest consulting fee, but I'm trying to solve a problem in a
>> timely way, as it would help me with healthcare decisions.
>>
>> Basically, I want to plot a time series graph showing my PSA (prostate
>> specific antigen) over time. The PSA is measured at irregular intervals,
>> and has been for over 4 years (and hopefully will continue for many more
>> years.) That should be a simple enough graph. I've already got a
>> javascript d3 example that does this, but I'd like to embed it in a
>> document, and to be able to generate PDF.
>
> This part is relatively straightforward.  Using your data example, you
> can do the following:
>
> * table
>
> #+name: measurements
> |   Date | PSA | |
>
> |+-+-|
> | 2017-08-11 | 185 | |
> | 2017-08-21 | | #ffdd99 |
> | 2017-09-19 | 854 | #ffdd99 |
>
> #+begin_src gnuplot :var data=measurements :file timeseries.pdf :results file
>   set xdata time
>   set timefmt "%Y-%m-%d"
>   set xrange ["2017-08-01":"2017-10-01"]
>   unset key
>   plot data using 1:2 with histeps
> #+end_src
>
> #+results:
> [[file:timeseries.pdf]]
>

FWIW, this is what I get in the *gnuplot* buffer when I C-c C-c on the
code block:

,
| 
|   G N U P L O T
|   Version 5.0 patchlevel 3last modified 2016-02-21 
| 
|   Copyright (C) 1986-1993, 1998, 2004, 2007-2016
|   Thomas Williams, Colin Kelley and many others
| 
|   gnuplot home: http://www.gnuplot.info
|   faq, bugs, etc:   type "help FAQ"
|   immediate help:   type "help"  (plot window: hit 'h')
| 
| Terminal type set to 'qt'
| gnuplot> data = "/tmp/babel-3079d_T/gnuplot-3079Hwc"
| gnuplot> set term pdf
| Terminal type set to 'pdfcairo'
| Options are ' transparent enhanced fontscale 0.5 size 5.00in, 3.00in '
| gnuplot> set output "timeseries.pdf"
| gnuplot> set xdata time
| gnuplot> set timefmt "%Y-%m-%d"
| gnuplot> set xrange ["2017-08-01":"2017-10-01"]
| gnuplot> unset key
| gnuplot> plot data using 1:2 with histeps
|  warning: Skipping data file with no valid points
|  ^
|  all points y value undefined!
`

-- 
Nick




Re: [O] Trying to get chart from table working

2017-10-02 Thread Peter Davis

On Mon, Oct 2, 2017, at 09:58 AM, Peter Davis wrote:
> 
> On Mon, Oct 2, 2017, at 09:54 AM, Peter Davis wrote:
> > 
> > On Mon, Oct 2, 2017, at 08:59 AM, Eric S Fraga wrote:
> > > On Monday,  2 Oct 2017 at 07:21, Peter Davis wrote:
> > > > On Mon, Oct 2, 2017, at 06:27 AM, Eric S Fraga wrote:
> > > >> On Sunday,  1 Oct 2017 at 15:06, Peter Davis wrote:
> > > >> > I do have those lines in my .org file, but no PDF was produced. I 
> > > >> > tried
> > > >> > switching to png, but still no file was produced.
> > > >> 
> > > >> Check the *gnuplot* buffer to see if there were any gnuplot errors.
> > > >> 
> > > >
> > > > There doesn't appear to be a *gnuplot* buffer.
> > > 
> > > Okay, maybe not when you export but what if you manually execute the
> > > gnuplot src block?  Do you get the PDF file generated?  If not, you
> > > should have a *gnuplot* buffer which you can then look at for errors.
> > 
> > Trying to run the table manually (C-M-g) just gives me:
> > 
> > Wrong type argument: arrayp, nil
> 
> Oh, execute C-c C-c in the block gives me
> 
> No org-babel-execute function for gnuplot!
> 
> So I guess something's not installed (correctly).

I added (gnuplot . t) to my org-babel-load-languages, and now I'm back
to

Wrong type argument: arrayp, nil

Sigh.


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-02 Thread Peter Davis

On Mon, Oct 2, 2017, at 09:54 AM, Peter Davis wrote:
> 
> On Mon, Oct 2, 2017, at 08:59 AM, Eric S Fraga wrote:
> > On Monday,  2 Oct 2017 at 07:21, Peter Davis wrote:
> > > On Mon, Oct 2, 2017, at 06:27 AM, Eric S Fraga wrote:
> > >> On Sunday,  1 Oct 2017 at 15:06, Peter Davis wrote:
> > >> > I do have those lines in my .org file, but no PDF was produced. I tried
> > >> > switching to png, but still no file was produced.
> > >> 
> > >> Check the *gnuplot* buffer to see if there were any gnuplot errors.
> > >> 
> > >
> > > There doesn't appear to be a *gnuplot* buffer.
> > 
> > Okay, maybe not when you export but what if you manually execute the
> > gnuplot src block?  Do you get the PDF file generated?  If not, you
> > should have a *gnuplot* buffer which you can then look at for errors.
> 
> Trying to run the table manually (C-M-g) just gives me:
> 
> Wrong type argument: arrayp, nil

Oh, execute C-c C-c in the block gives me

No org-babel-execute function for gnuplot!

So I guess something's not installed (correctly).


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-02 Thread Peter Davis

On Mon, Oct 2, 2017, at 08:59 AM, Eric S Fraga wrote:
> On Monday,  2 Oct 2017 at 07:21, Peter Davis wrote:
> > On Mon, Oct 2, 2017, at 06:27 AM, Eric S Fraga wrote:
> >> On Sunday,  1 Oct 2017 at 15:06, Peter Davis wrote:
> >> > I do have those lines in my .org file, but no PDF was produced. I tried
> >> > switching to png, but still no file was produced.
> >> 
> >> Check the *gnuplot* buffer to see if there were any gnuplot errors.
> >> 
> >
> > There doesn't appear to be a *gnuplot* buffer.
> 
> Okay, maybe not when you export but what if you manually execute the
> gnuplot src block?  Do you get the PDF file generated?  If not, you
> should have a *gnuplot* buffer which you can then look at for errors.

Trying to run the table manually (C-M-g) just gives me:

Wrong type argument: arrayp, nil


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-02 Thread Eric S Fraga
On Monday,  2 Oct 2017 at 07:21, Peter Davis wrote:
> On Mon, Oct 2, 2017, at 06:27 AM, Eric S Fraga wrote:
>> On Sunday,  1 Oct 2017 at 15:06, Peter Davis wrote:
>> > I do have those lines in my .org file, but no PDF was produced. I tried
>> > switching to png, but still no file was produced.
>> 
>> Check the *gnuplot* buffer to see if there were any gnuplot errors.
>> 
>
> There doesn't appear to be a *gnuplot* buffer.

Okay, maybe not when you export but what if you manually execute the
gnuplot src block?  Do you get the PDF file generated?  If not, you
should have a *gnuplot* buffer which you can then look at for errors.

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-02 Thread Peter Davis

On Mon, Oct 2, 2017, at 07:22 AM, Robert Horn wrote:
> 
> Peter Davis writes:
> 
> > Basically, I want to plot a time series graph showing my PSA (prostate
> > specific antigen) over time. The PSA is measured at irregular intervals,
> > and has been for over 4 years (and hopefully will continue for many more
> > years.) That should be a simple enough graph. I've already got a
> > javascript d3 example that does this, but I'd like to embed it in a
> > document, and to be able to generate PDF.
> >
> > Further, I want to be able to show different time intervals with tinted
> > bands spanning the full range of the graph, and having specific start
> > and end dates. These would represent various medical treatments I've
> > undergone. I have a rough example I've mocked up in Photoshop, but, of
> > course, I want to be able to add new data and re-generate the chart as
> > needed. I don't know if I can attach a PNG to an email on this list.
> >
> 
> I do something similar for managing diabetes.
> 
> I use org-mode to manage some (not all) of the data tables and org-babel
> to control a graphics and statistics analysis in R.  R can also handle
> input in other formats, such as CSV, that I get from some sources. The
> results are also displayed in the org window as output from R.
> 
> This is a much heavier weight solution, since it involves learning R. 
> But
> the graphics capabilities are immensely richer than gnuplot and the
> mathematical capabilities for statistics and time series analysis are
> immensely richer in R.
> 
> If learning R benefits your work or career you might explore this.
> 

Thanks, Robert. I've had considered R as a possible tool for this
effort. I actually used it briefly for a data visualization course I
took a few years ago, but there's still a lot more learning I would have
to do to accomplish this. 

On the other hand, it seems every other path I've tried has a large
learning curve too, so I should give R another look.

Thanks,
-pd


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-02 Thread Robert Horn

Peter Davis writes:

> Basically, I want to plot a time series graph showing my PSA (prostate
> specific antigen) over time. The PSA is measured at irregular intervals,
> and has been for over 4 years (and hopefully will continue for many more
> years.) That should be a simple enough graph. I've already got a
> javascript d3 example that does this, but I'd like to embed it in a
> document, and to be able to generate PDF.
>
> Further, I want to be able to show different time intervals with tinted
> bands spanning the full range of the graph, and having specific start
> and end dates. These would represent various medical treatments I've
> undergone. I have a rough example I've mocked up in Photoshop, but, of
> course, I want to be able to add new data and re-generate the chart as
> needed. I don't know if I can attach a PNG to an email on this list.
>

I do something similar for managing diabetes.

I use org-mode to manage some (not all) of the data tables and org-babel
to control a graphics and statistics analysis in R.  R can also handle
input in other formats, such as CSV, that I get from some sources. The
results are also displayed in the org window as output from R.

This is a much heavier weight solution, since it involves learning R.  But
the graphics capabilities are immensely richer than gnuplot and the
mathematical capabilities for statistics and time series analysis are
immensely richer in R.

If learning R benefits your work or career you might explore this.

R Horn



Re: [O] Trying to get chart from table working

2017-10-02 Thread Peter Davis


On Mon, Oct 2, 2017, at 06:27 AM, Eric S Fraga wrote:
> On Sunday,  1 Oct 2017 at 15:06, Peter Davis wrote:
> > I do have those lines in my .org file, but no PDF was produced. I tried
> > switching to png, but still no file was produced.
> 
> Check the *gnuplot* buffer to see if there were any gnuplot errors.
> 

There doesn't appear to be a *gnuplot* buffer.

Thanks,
-pd

-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-02 Thread Eric S Fraga
On Sunday,  1 Oct 2017 at 15:06, Peter Davis wrote:
> I do have those lines in my .org file, but no PDF was produced. I tried
> switching to png, but still no file was produced.

Check the *gnuplot* buffer to see if there were any gnuplot errors.

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-10-01 Thread Peter Davis
I do have those lines in my .org file, but no PDF was produced. I tried
switching to png, but still no file was produced.

Thanks,
-pd

On Sun, Oct 1, 2017, at 02:51 PM, Thierry Banel wrote:
> Do you get the following lines?
> (you can erase them, they will be recreated).
> 
>#+results:
>[[file:timeseries.pdf]]
> 
> If you click on the link, it should open okular or acrobat reader or 
> whatever displaying the plot.
> 
> Otherwise you can try a different format, PNG for instance:
> 
>#+begin_src gnuplot :var data=measurements :file timeseries.png 
> :results inline
> 
> 
> 
> 
> On 01/10/2017 15:47, Peter Davis wrote:
> > On Sat, Sep 30, 2017, at 09:25 AM, Eric S Fraga wrote:
> >> On Friday, 29 Sep 2017 at 17:32, Peter Davis wrote:
> >>> I'm sorry to belabor this, but I could use some help. I'd be willing to
> >>> pay a modest consulting fee, but I'm trying to solve a problem in a
> >>> timely way, as it would help me with healthcare decisions.
> >>>
> >>> Basically, I want to plot a time series graph showing my PSA (prostate
> >>> specific antigen) over time. The PSA is measured at irregular intervals,
> >>> and has been for over 4 years (and hopefully will continue for many more
> >>> years.) That should be a simple enough graph. I've already got a
> >>> javascript d3 example that does this, but I'd like to embed it in a
> >>> document, and to be able to generate PDF.
> >> This part is relatively straightforward.  Using your data example, you
> >> can do the following:
> >>
> > Thank you for the example, Eric. Running this gives me a page with the
> > table and the code on it, but no plot. Here's what *Messages* says:
> >
> > gnuplot-mode 0.7-beta -- determining gnuplot version ..
> > gnuplot-mode 0.7-beta (gnuplot 5.2) -- report bugs with "C-c C-u"
> > Saving file /Users/peterdavis/Dropbox/Org/t.org...
> > Wrote /Users/peterdavis/Dropbox/Org/t.org
> > Mark set
> > Saving file /Users/peterdavis/Dropbox/Org/t.org...
> > Wrote /Users/peterdavis/Dropbox/Org/t.org
> > org-babel-exp process gnuplot at position 292...
> > Saving file /Users/peterdavis/Dropbox/Org/t.tex...
> > Wrote /Users/peterdavis/Dropbox/Org/t.tex
> > Processing LaTeX file ./t.tex...
> > PDF file produced.
> > Running open /Users/peterdavis/Dropbox/Org/t.pdf...done
> >
> > Thank you.
> >
> > -pd
> >
> >
> >> The colouring bit is harder and I don't know whether it's possible or
> >> not.  I suggest you look at examples on the web, e.g.
> >>
> >> http://gnuplot.sourceforge.net/demo/
> >>
> >> to see if anything fits what you are trying to do.
> >>
> >> HTH,
> >> eric
> >>
> >> -- 
> >> : Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c
> >> Email had 2 attachments:
> >> + t.org
> >>1k (text/x-org)
> >> + signature.asc
> >>1k (application/pgp-signature)
> >
> 
> 


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-10-01 Thread Thierry Banel

Do you get the following lines?
(you can erase them, they will be recreated).

  #+results:
  [[file:timeseries.pdf]]

If you click on the link, it should open okular or acrobat reader or 
whatever displaying the plot.


Otherwise you can try a different format, PNG for instance:

  #+begin_src gnuplot :var data=measurements :file timeseries.png 
:results inline





On 01/10/2017 15:47, Peter Davis wrote:

On Sat, Sep 30, 2017, at 09:25 AM, Eric S Fraga wrote:

On Friday, 29 Sep 2017 at 17:32, Peter Davis wrote:

I'm sorry to belabor this, but I could use some help. I'd be willing to
pay a modest consulting fee, but I'm trying to solve a problem in a
timely way, as it would help me with healthcare decisions.

Basically, I want to plot a time series graph showing my PSA (prostate
specific antigen) over time. The PSA is measured at irregular intervals,
and has been for over 4 years (and hopefully will continue for many more
years.) That should be a simple enough graph. I've already got a
javascript d3 example that does this, but I'd like to embed it in a
document, and to be able to generate PDF.

This part is relatively straightforward.  Using your data example, you
can do the following:


Thank you for the example, Eric. Running this gives me a page with the
table and the code on it, but no plot. Here's what *Messages* says:

gnuplot-mode 0.7-beta -- determining gnuplot version ..
gnuplot-mode 0.7-beta (gnuplot 5.2) -- report bugs with "C-c C-u"
Saving file /Users/peterdavis/Dropbox/Org/t.org...
Wrote /Users/peterdavis/Dropbox/Org/t.org
Mark set
Saving file /Users/peterdavis/Dropbox/Org/t.org...
Wrote /Users/peterdavis/Dropbox/Org/t.org
org-babel-exp process gnuplot at position 292...
Saving file /Users/peterdavis/Dropbox/Org/t.tex...
Wrote /Users/peterdavis/Dropbox/Org/t.tex
Processing LaTeX file ./t.tex...
PDF file produced.
Running open /Users/peterdavis/Dropbox/Org/t.pdf...done

Thank you.

-pd



The colouring bit is harder and I don't know whether it's possible or
not.  I suggest you look at examples on the web, e.g.

http://gnuplot.sourceforge.net/demo/

to see if anything fits what you are trying to do.

HTH,
eric

--
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c
Email had 2 attachments:
+ t.org
   1k (text/x-org)
+ signature.asc
   1k (application/pgp-signature)







Re: [O] Trying to get chart from table working

2017-10-01 Thread Peter Davis

On Sat, Sep 30, 2017, at 09:25 AM, Eric S Fraga wrote:
> On Friday, 29 Sep 2017 at 17:32, Peter Davis wrote:
> > I'm sorry to belabor this, but I could use some help. I'd be willing to
> > pay a modest consulting fee, but I'm trying to solve a problem in a
> > timely way, as it would help me with healthcare decisions.
> >
> > Basically, I want to plot a time series graph showing my PSA (prostate
> > specific antigen) over time. The PSA is measured at irregular intervals,
> > and has been for over 4 years (and hopefully will continue for many more
> > years.) That should be a simple enough graph. I've already got a
> > javascript d3 example that does this, but I'd like to embed it in a
> > document, and to be able to generate PDF.
> 
> This part is relatively straightforward.  Using your data example, you
> can do the following:
> 

Thank you for the example, Eric. Running this gives me a page with the
table and the code on it, but no plot. Here's what *Messages* says:

gnuplot-mode 0.7-beta -- determining gnuplot version ..
gnuplot-mode 0.7-beta (gnuplot 5.2) -- report bugs with "C-c C-u"
Saving file /Users/peterdavis/Dropbox/Org/t.org...
Wrote /Users/peterdavis/Dropbox/Org/t.org
Mark set
Saving file /Users/peterdavis/Dropbox/Org/t.org...
Wrote /Users/peterdavis/Dropbox/Org/t.org
org-babel-exp process gnuplot at position 292...
Saving file /Users/peterdavis/Dropbox/Org/t.tex...
Wrote /Users/peterdavis/Dropbox/Org/t.tex
Processing LaTeX file ./t.tex...
PDF file produced.
Running open /Users/peterdavis/Dropbox/Org/t.pdf...done

Thank you.

-pd


> 
> The colouring bit is harder and I don't know whether it's possible or
> not.  I suggest you look at examples on the web, e.g.
> 
> http://gnuplot.sourceforge.net/demo/
> 
> to see if anything fits what you are trying to do.
> 
> HTH,
> eric
> 
> -- 
> : Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c
> Email had 2 attachments:
> + t.org
>   1k (text/x-org)
> + signature.asc
>   1k (application/pgp-signature)


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-09-30 Thread Eric S Fraga
On Friday, 29 Sep 2017 at 17:32, Peter Davis wrote:
> I'm sorry to belabor this, but I could use some help. I'd be willing to
> pay a modest consulting fee, but I'm trying to solve a problem in a
> timely way, as it would help me with healthcare decisions.
>
> Basically, I want to plot a time series graph showing my PSA (prostate
> specific antigen) over time. The PSA is measured at irregular intervals,
> and has been for over 4 years (and hopefully will continue for many more
> years.) That should be a simple enough graph. I've already got a
> javascript d3 example that does this, but I'd like to embed it in a
> document, and to be able to generate PDF.

This part is relatively straightforward.  Using your data example, you
can do the following:

* table
#+name: measurements
|   Date | PSA | |
|+-+-|
| 2017-08-11 | 185 | |
| 2017-08-21 | | #ffdd99 |
| 2017-09-19 | 854 | #ffdd99 |

#+begin_src gnuplot :var data=measurements :file timeseries.pdf :results file
  set xdata time
  set timefmt "%Y-%m-%d"
  set xrange ["2017-08-01":"2017-10-01"]
  unset key
  plot data using 1:2 with histeps
#+end_src

#+results:
[[file:timeseries.pdf]]

The colouring bit is harder and I don't know whether it's possible or
not.  I suggest you look at examples on the web, e.g.

http://gnuplot.sourceforge.net/demo/

to see if anything fits what you are trying to do.

HTH,
eric

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c


signature.asc
Description: PGP signature


Re: [O] Trying to get chart from table working

2017-09-29 Thread Peter Davis

I'm sorry to belabor this, but I could use some help. I'd be willing to
pay a modest consulting fee, but I'm trying to solve a problem in a
timely way, as it would help me with healthcare decisions.

Basically, I want to plot a time series graph showing my PSA (prostate
specific antigen) over time. The PSA is measured at irregular intervals,
and has been for over 4 years (and hopefully will continue for many more
years.) That should be a simple enough graph. I've already got a
javascript d3 example that does this, but I'd like to embed it in a
document, and to be able to generate PDF.

Further, I want to be able to show different time intervals with tinted
bands spanning the full range of the graph, and having specific start
and end dates. These would represent various medical treatments I've
undergone. I have a rough example I've mocked up in Photoshop, but, of
course, I want to be able to add new data and re-generate the chart as
needed. I don't know if I can attach a PNG to an email on this list.

Unfortunately, I don't have enough emacs lisp knowledge, or org-mode
knowledge, or gnuplot knowledge to know how to make this all work. I
have not even be able to get the org-plot example to work. (I have been
using org for various types of documents for a number of years, and can
generally pick things up quickly, but I'm overwhelmed by this.)

I was thinking of having a table like:


...
| *Date* | *PSA* | *Treatment* |
| 2017-08-11 | 185 | |
| 2017-08-21 | | #ffdd99 |
| 2017-09-19 | 854 | #ffdd99 |
...


So some rows would contain a PSA measurement, some a background tint,
and some both. I've never seen a visualization like this, but I think it
would be very helpful to have a single timeline that shows periods of
various treatments and the PSA value. There are probably better ways to
specify the starting and ending dates of treatments, but this seemed
amenable to simple iterative processing.

I've considered possible tools for this, including d3, PostScript, etc.,
but I think Org would be best for maintainability, allowing me to add
notes, etc.

I know this is a tall order, but it's beyond my capabilities right now.
Any recommendations or suggestions greatly appreciated.

Thanks,
-pd

-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-09-29 Thread Peter Davis

On Fri, Sep 29, 2017, at 11:42 AM, Peter Davis wrote:
> 
> On Fri, Sep 29, 2017, at 10:51 AM, Eric S Fraga wrote:
> > On Friday, 29 Sep 2017 at 10:16, Peter Davis wrote:
> > > I'm trying out the org-plot example, but when I enter C-M-g on a
> > > table, I get:
> > >
> > > Cannot open load file: No such file or directory, gnuplot
> > >
> > > I verified that gnuplot is installed, and that /usr/local/bin is in
> > > both the PATH and the exec-path for emacs. Is there something else I
> > > need to do?
> > 
> > It may refer to gnuplot.el (found in gnuplot-mode debian package for me)
> > as I think org uses this to execute gnuplot commands?
> > 
> 
> Thank you, Eric. I did install gnuplot-mode via the list-packages
> interface, but I can't find a gnuplot.el file on my system.
> 

Aha! Just installing gnuplot did something. Now I get

org-export-data-with-backend: Wrong type argument: arrayp, nil


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-09-29 Thread Peter Davis

On Fri, Sep 29, 2017, at 10:51 AM, Eric S Fraga wrote:
> On Friday, 29 Sep 2017 at 10:16, Peter Davis wrote:
> > I'm trying out the org-plot example, but when I enter C-M-g on a
> > table, I get:
> >
> > Cannot open load file: No such file or directory, gnuplot
> >
> > I verified that gnuplot is installed, and that /usr/local/bin is in
> > both the PATH and the exec-path for emacs. Is there something else I
> > need to do?
> 
> It may refer to gnuplot.el (found in gnuplot-mode debian package for me)
> as I think org uses this to execute gnuplot commands?
> 

Thank you, Eric. I did install gnuplot-mode via the list-packages
interface, but I can't find a gnuplot.el file on my system.

Thanks!
-pd

-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Trying to get chart from table working

2017-09-29 Thread Eric S Fraga
On Friday, 29 Sep 2017 at 10:16, Peter Davis wrote:
> I'm trying out the org-plot example, but when I enter C-M-g on a
> table, I get:
>
> Cannot open load file: No such file or directory, gnuplot
>
> I verified that gnuplot is installed, and that /usr/local/bin is in
> both the PATH and the exec-path for emacs. Is there something else I
> need to do?

It may refer to gnuplot.el (found in gnuplot-mode debian package for me)
as I think org uses this to execute gnuplot commands?

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-87-g3c83f1


signature.asc
Description: PGP signature


[O] Trying to get chart from table working

2017-09-29 Thread Peter Davis
I'm trying out the org-plot example, but when I enter C-M-g on a table, 
I get:



Cannot open load file: No such file or directory, gnuplot


I verified that gnuplot is installed, and that /usr/local/bin is in both 
the PATH and the exec-path for emacs. Is there something else I need to do?



Ultimately I'm trying to figure out how to plot a time series graph, and 
then to represent different time intervals with colored bands in the 
background.



Thanks,

-pd


--

Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com