-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathREADME.org
More file actions
78 lines (57 loc) · 2.25 KB
/
Copy pathREADME.org
File metadata and controls
78 lines (57 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#+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