Andy Wingo <wi...@pobox.com> writes:

>  4) If you're forking to run gnuplot, why not do so from Scheme?

Coincidentally, I recently wrote this:

(define (gnuplot file-name plot-command)
  (let ((pipe (open-output-pipe "gnuplot -"))) 
    (format pipe
            "\
set terminal png
set output '~a'
~a
quit
"
            file-name
            plot-command)
    (close-pipe pipe))
  (system (string-append "display " file-name)))

Example usage:

(gnuplot "table1.png"
  "plot 'table1.txt' using 1:6 with lines, 4*x/log(2*x), 4*x/log(x)")

Daniel, if you feel like including this in the tutorial as an
alternative to the C code, please do so.

> Anyway, IMO, FWIW, etc. If you don't reply, I'll probably just commit
> your tutorial more-or-less as-is to the repo :)

Although the tutorial is now on the web, I still haven't done anything
as regards committing it to Git.  That's not because I think we
shouldn't; it just that I haven't pondered how best to do it yet.

    Neil


Reply via email to