Skip to content

Repository files navigation

#+TITLE: =gnuplot=-interface package

* Package features
Low level interface to =gnuplot= that provides:
- start of =gnuplot= process
- passing raw =gnuplot= commands
- echo printing of sent commands 

* Example of use
  Typical usage:
#+BEGIN_SRC lisp
(start-gnuplot) ;; starts the process
(init-gnuplot) ;; optional, to initializes terminal
(hello-world) ;;  plot of cos(x)
(command "command-string") ;; send command to gnuplot
(echo-command) ;; sell last sent command
#+END_SRC

  For passing complex =gnuplot= commands that consists of many lines,
  use the =send-line= and =send-line-break= commands
#+BEGIN_SRC lisp
(do-stuff (action actions)
   (send-line (action->string action)))
(sent-line-break)
#+END_SRC

  A companion library ~cl--gnuplot-command-string~ provides a few
  facilities for creating gnuplot commands.

* Platforms
  The interface was developed and tested on the following platforms
  - Linux & =SBCL=
  - Windows & Cygwin & CLISP
    - =wgnuplot=
    - =gnuplot= was not tested in a while as I cannot get X11 on my
      Windows machines
  - Windows & CCL

  

* Installation on Windows

  Interacting with GNUPlot on Windows does not seem as straightforward
  as on Linux/Darwin.

  For that I introduced a user-setup package in which the user defines
  the path to the gnuplot executable and terminal.

  Currently this is best described by code.  In the =lisrrc= (or
  equivalent) file the following needs to be execute in the
  =user-setup= package (make sure the package is defined before this).
  #+BEGIN_SRC lisp
    (in-package :user-setup)

    (eval-when (:compile-toplevel :load-toplevel :execute)
      (defstruct (gnuplot-setup (:conc-name gnuplot-)) executable terminal))

    (defparameter user-setup::*gnuplot-setup* (make-gnuplot-setup))

    (setf (gnuplot-executable *gnuplot-setup*) "E:/GNUPLOT/BIN/GNUPLOT.EXE"
          (gnuplot-terminal *gnuplot-setup*) :WINDOWS)

    (export '(*gnuplot-setup* gnuplot-executable gnuplot-terminal) 'user-setup)
  #+END_SRC

  


* Caveats
- stream plumbing is not thoroughly tested
- windows management is not implemented

* To do
  - multiple windows management
  - Figure out how to use clisp's =ext:run-program= instead of
    =ext:make-pipe-io-stream=
    - That would allow me to use the =external-program= package

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages