Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the clgplot Reference Manual, version 0.2, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 04:23:28 2022 GMT+0.
• Introduction | What clgplot is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
* clgplot clgplot is a Gnuplot front-end on Common Lisp. ** Dependencies Gnuplot (>4) ** Installation #+BEGIN_SRC sh cd ~/quicklisp/local-projects git clone https://github.com/masatoi/clgplot.git #+END_SRC In case of using Roswell, simply #+BEGIN_SRC sh ros install masatoi/clgplot #+END_SRC #+BEGIN_SRC lisp (ql:quickload :clgplot) #+END_SRC ** Usage clgplot generates a data file and a setting file of Gnuplot to tmp directory and execute Gnuplot with -persist option. Paths to these files or command can be changed as below. #+BEGIN_SRC lisp (defparameter clgp:*gnuplot-path* "gnuplot") (defparameter clgp:*tmp-dat-file* "/tmp/clgplot-tmp.dat") (defparameter clgp:*tmp-gp-file* "/tmp/clgplot-tmp.gp") #+END_SRC *** Plot of single function #+BEGIN_SRC lisp (defparameter *x-list* (loop for i from (- pi) to pi by 0.1 collect i)) (clgp:plot (mapcar #'sin *x-list*)) #+END_SRC [[./docs/img/clgp01.png]] Plots can be output to a file as follows. #+begin_src lisp (clgp:plot (mapcar #'sin *x-list*) :output "/path/to/file.png") (clgp:plot (mapcar #'sin *x-list*) :output "/path/to/file.png" :output-format :png) (clgp:plot (mapcar #'sin *x-list*) :output "/path/to/file.pdf" :output-format :pdf) (clgp:plot (mapcar #'sin *x-list*) :output "/path/to/file.eps" :output-format :eps) #+end_src *** Plot of multiple functions with annotations #+BEGIN_SRC lisp (clgp:plots (list (mapcar #'sin *x-list*) (mapcar #'cos *x-list*) (mapcar #'tan *x-list*)) :x-seqs (list *x-list* *x-list* *x-list*) :x-range (list (- pi) pi) :y-range '(-1 1) :title-list '("sin" "cos" "tan") :x-label "x" :y-label "f(x)") #+END_SRC [[./docs/img/clgp02.png]] #+begin_src lisp (let* ((rand-x-list (loop repeat 100 collect (- (random (* 2 pi)) pi))) (rand-y-list (mapcar (lambda (x) (+ (sin x) (random-normal :sd 0.1d0))) rand-x-list))) (clgp:plots (list (mapcar #'sin *x-list*) rand-y-list) :x-seqs (list *x-list* rand-x-list) :style '(line point))) #+end_src [[./docs/img/clgp02-2.png]] *** 3D plot examples #+BEGIN_SRC lisp (clgp:splot (lambda (x y) (+ (sin x) (cos y))) *x-list* ; x *x-list* ; y :view-point '(20 45) :z-scale 1.5) #+END_SRC [[./docs/img/clgp03.png]] #+BEGIN_SRC lisp (clgp:splot (lambda (x y) (+ (sin x) (cos y))) *x-list* ; x *x-list* ; y :map t) #+END_SRC [[./docs/img/clgp04.png]] *** Plot matrix (2-dimensional array) #+begin_src lisp (defparameter mat (make-array '(20 20) :initial-contents (loop for i from (- pi) to (- pi 0.1) by (/ pi 10) collect (loop for j from (- pi) to (- pi 0.1) by (/ pi 10) collect (+ (sin i) (cos j)))))) (clgp:splot-matrix mat) #+end_src [[./docs/img/clgp05.png]] *** Histogram #+begin_src lisp (defun random-normal (&key (mean 0d0) (sd 1d0)) (let ((alpha (random 1.0d0)) (beta (random 1.0d0))) (+ (* sd (sqrt (* -2 (log alpha))) (sin (* 2 pi beta))) mean))) (clgp:plot-histogram (loop repeat 3000 collect (random-normal)) ; samples 30 ; number of bin ) #+end_src [[./docs/img/clgp06.png]] *** Multiplot #+begin_src lisp (clgp:multiplot (:layout (2 2) :output "/tmp/multiplot.png" :output-format :png) (clgp:plot (mapcar #'sin *x-list*) :style 'lines :key nil) (clgp:plot (mapcar #'sin *x-list*) :style 'points :key nil) (clgp:plot (mapcar #'sin *x-list*) :style 'impulses :key nil) (clgp:plots (list (mapcar #'sin *x-list*) (mapcar #'cos *x-list*) (mapcar #'tan *x-list*)) :x-seqs (list *x-list* *x-list* *x-list*) :x-range (list (- pi) pi) :y-range '(-1 1) :key nil)) #+end_src [[./docs/img/multiplot.png]] ** Author Satoshi Imai (satoshi.imai@gmail.com) ** License The MIT license
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The clgplot system |
Satoshi Imai
MIT Licence
A Gnuplot front-end for Common lisp
* clgplot
clgplot is a Gnuplot front-end on Common Lisp.
** Dependencies
Gnuplot (>4)
** Installation
#+BEGIN_SRC sh
cd ~/quicklisp/local-projects
git clone https://github.com/masatoi/clgplot.git
#+END_SRC
In case of using Roswell, simply
#+BEGIN_SRC sh
ros install masatoi/clgplot
#+END_SRC
#+BEGIN_SRC lisp
(ql:quickload :clgplot)
#+END_SRC
** Usage
clgplot generates a data file and a setting file of Gnuplot to tmp directory and execute Gnuplot with -persist option.
Paths to these files or command can be changed as below.
#+BEGIN_SRC lisp
(defparameter clgp:*gnuplot-path* "gnuplot")
(defparameter clgp:*tmp-dat-file* "/tmp/clgplot-tmp.dat")
(defparameter clgp:*tmp-gp-file* "/tmp/clgplot-tmp.gp")
#+END_SRC
*** Plot of single function
#+BEGIN_SRC lisp
(defparameter *x-list* (loop for i from (- pi) to pi by 0.1 collect i))
(clgp:plot (mapcar #’sin *x-list*))
#+END_SRC
[[./docs/img/clgp01.png]]
Plots can be output to a file as follows.
#+begin_src lisp
(clgp:plot (mapcar #’sin *x-list*) :output "/path/to/file.png")
(clgp:plot (mapcar #’sin *x-list*) :output "/path/to/file.png" :output-format :png)
(clgp:plot (mapcar #’sin *x-list*) :output "/path/to/file.pdf" :output-format :pdf)
(clgp:plot (mapcar #’sin *x-list*) :output "/path/to/file.eps" :output-format :eps)
#+end_src
*** Plot of multiple functions with annotations
#+BEGIN_SRC lisp
(clgp:plots (list (mapcar #’sin *x-list*)
(mapcar #’cos *x-list*)
(mapcar #’tan *x-list*))
:x-seqs (list *x-list* *x-list* *x-list*)
:x-range (list (- pi) pi)
:y-range ’(-1 1)
:title-list ’("sin" "cos" "tan")
:x-label "x"
:y-label "f(x)")
#+END_SRC
[[./docs/img/clgp02.png]]
#+begin_src lisp
(let* ((rand-x-list (loop repeat 100 collect (- (random (* 2 pi)) pi)))
(rand-y-list (mapcar (lambda (x) (+ (sin x) (random-normal :sd 0.1d0))) rand-x-list)))
(clgp:plots (list (mapcar #’sin *x-list*)
rand-y-list)
:x-seqs (list *x-list* rand-x-list)
:style ’(line point)))
#+end_src
[[./docs/img/clgp02-2.png]]
*** 3D plot examples
#+BEGIN_SRC lisp
(clgp:splot (lambda (x y) (+ (sin x) (cos y)))
*x-list* ; x
*x-list* ; y
:view-point ’(20 45) :z-scale 1.5)
#+END_SRC
[[./docs/img/clgp03.png]]
#+BEGIN_SRC lisp
(clgp:splot (lambda (x y) (+ (sin x) (cos y)))
*x-list* ; x
*x-list* ; y
:map t)
#+END_SRC
[[./docs/img/clgp04.png]]
*** Plot matrix (2-dimensional array)
#+begin_src lisp
(defparameter mat
(make-array ’(20 20)
:initial-contents
(loop for i from (- pi) to (- pi 0.1) by (/ pi 10) collect
(loop for j from (- pi) to (- pi 0.1) by (/ pi 10) collect
(+ (sin i) (cos j))))))
(clgp:splot-matrix mat)
#+end_src
[[./docs/img/clgp05.png]]
*** Histogram
#+begin_src lisp
(defun random-normal (&key (mean 0d0) (sd 1d0))
(let ((alpha (random 1.0d0))
(beta (random 1.0d0)))
(+ (* sd
(sqrt (* -2 (log alpha)))
(sin (* 2 pi beta)))
mean)))
(clgp:plot-histogram (loop repeat 3000 collect (random-normal)) ; samples
30 ; number of bin
)
#+end_src
[[./docs/img/clgp06.png]]
*** Multiplot
#+begin_src lisp
(clgp:multiplot (:layout (2 2) :output "/tmp/multiplot.png" :output-format :png)
(clgp:plot (mapcar #’sin *x-list*) :style ’lines :key nil)
(clgp:plot (mapcar #’sin *x-list*) :style ’points :key nil)
(clgp:plot (mapcar #’sin *x-list*) :style ’impulses :key nil)
(clgp:plots (list (mapcar #’sin *x-list*)
(mapcar #’cos *x-list*)
(mapcar #’tan *x-list*))
:x-seqs (list *x-list* *x-list* *x-list*)
:x-range (list (- pi) pi)
:y-range ’(-1 1)
:key nil))
#+end_src
[[./docs/img/multiplot.png]]
** Author
Satoshi Imai (satoshi.imai@gmail.com)
** License
The MIT license
0.2
clgplot.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The clgplot/src module |
clgplot (system)
src/
clgplot.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The clgplot.asd file | ||
• The clgplot/src/clgplot.lisp file |
Next: The clgplot/src/clgplot․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
clgplot.asd
clgplot (system)
Previous: The clgplot․asd file, Up: Lisp files [Contents][Index]
src (module)
src/clgplot.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The clgplot-asd package | ||
• The clgplot package |
Next: The clgplot package, Previous: Packages, Up: Packages [Contents][Index]
clgplot.asd
Previous: The clgplot-asd package, Up: Packages [Contents][Index]
clgplot.lisp (file)
clgp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported macros | ||
• Exported functions |
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
Next: Exported functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
clgplot.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
clgplot.lisp (file)
Divide samples by the range width equally and count the number of samples appear in each bins.
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal macros | ||
• Internal functions |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
clgplot.lisp (file)
Previous: Internal macros, Up: Internal definitions [Contents][Index]
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
Separate interval (a,b) equally to n bins, then return index of the bin which x belongs to.
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
clgplot.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L M |
---|
Jump to: | C F L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | A C D F H L M N P R S |
---|
Jump to: | A C D F H L M N P R S |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Jump to: | C P S |
---|