Archived
1
0
Fork 0
Thin Common Lisp wrapper for gnuplot. Also check out the incudine-plot repo here.
This repository has been archived on 2025-11-20. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2025-11-20 15:15:51 +01:00
.gitignore first commit. 2018-08-27 12:07:07 +02:00
cl-plot.asd changed uiop version dependency 2018-08-30 14:49:20 +02:00
cl-plot.lisp misc 2022-10-23 16:35:30 +02:00
package.lisp added with-gnuplot-instance to simplify custom plot methods. 2018-09-09 16:22:41 +02:00
README.org added deprecated info to README. 2025-11-20 14:48:12 +01:00

This Repository is deprecated!

The cl-plot repository has been completely integrated into Clamps and is developed there. The archive here is only kept for historical reasons. This archive will not receive further updates or patches. Issues and pull requests will not be looked at here either, please submit your patches and issue tickets on the Clamps repository on Codeberg, or send them directly via good old email patches to the author.* cl-plot

License

**********************************************************************

Copyright (c) 2018 Orm Finnendahl <[email protected]>

Revision history: See git repository.

This program is free software; you can redistribute it and/or
modify it under the terms of the Gnu Public License, version 2 or
later. See https://www.gnu.org/licenses/gpl-2.0.html for the text
of this agreement.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

**********************************************************************

Overview

cl-plot is a thin Common Lisp Wrapper for gnuplot It expects gnuplot at /usr/bin/gnuplot (change to your needs using the variable *GNUPLOT-COMMAND*).

The central function is plot, which at this point accepts lists, one-dimensional arrays or functions. plot is implemented as a generic function so that it can be specialized on different data types and easily extended (see for example the incudine-plot package on this github account which is used for visualising musical data like envelopes or buffers).

The plot function returns its argument unchanged. This enables to wrap the (plot …) form around suitable subexpressions within code to graphically monitor intermediate results of larger code blocks without changing the overall outcome of the code.

INSTALLATION

cl-plot depends on uiop.

The recommended way is to use quicklisp and put the cl-plot folder into <user-home-dir>/quicklisp/local-projects/.

Then load it with

  CL-USER> (ql:quickload "cl-plot")
  To load "cl-plot":
  Load 1 ASDF system:
  cl-plot
  ; Loading "cl-plot"
  .
  ("cl-plot")
  CL-USER> (in-package :cl-plot)
  #<PACKAGE "CL-PLOT">
  CL-PLOT>

Plotting Data Lists

  ;;; 2-dimensional:

  (plot
   (loop for count below 20
      collect (list count (random 40.0)))
   :grid nil)

  ;;; 1-dimensional:

  (plot
   (loop for count below 20
      collect (random 40.0)))

Plotting Arrays

  (plot #(3 1 8 6 5 2 4))

  (plot #((0 3) (1 1) (2 8) (3 6) (4 5) (5 2) (6 4)))

  (plot #(#(0 3) #(1 1) #(2 8) #(3 6) #(4 5) #(5 2) #(6 4)))

Plotting Functions

  (plot #'sin :region `(0 ,(* 2 pi)))

  (plot #'exp :region `(0 4))

  ;; default region is '(0 1)

  (plot #'sin)

cl-plot

License

**********************************************************************
Copyright (c) 2018 Orm Finnendahl <[email protected]>
;;;
Revision history: See git repository.
;;;
This program is free software; you can redistribute it and/or
modify it under the terms of the Gnu Public License, version 2 or
later. See https://www.gnu.org/licenses/gpl-2.0.html for the text
of this agreement.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
;;;
**********************************************************************

cl-plot is a thin Common Lisp Wrapper for gnuplot. It expects gnuplot at /usr/bin/gnuplot (change to your needs).

The central method is plot, which at this point accepts lists, one-dimensional arrays or functions.

INSTALLATION

cl-plot depends on uiop.

The recommended way is to use quicklisp and put the cl-plot folder into <home>/quicklisp/local-projects/.

Then load it with

  (ql:quickload "cl-plot")

  (in-package :cl-plot)

  ;;; plotting data lists:

  ;;; 2-dimensional:

  (plot
   (loop for count below 20
      collect (list count (random 40.0)))
   :grid nil)

  ;;; 1-dimensional:

  (plot
   (loop for count below 20
      collect (random 40.0)))


  ;;; plotting arrays:

  (plot #(3 1 8 6 5 2 4))

  (plot #((0 3) (1 1) (2 8) (3 6) (4 5) (5 2) (6 4)))

  (plot #(#(0 3) #(1 1) #(2 8) #(3 6) #(4 5) #(5 2) #(6 4)))


  ;;; plotting functions:

  (plot #'sin :region `(0 ,(* 2 pi)))

  (plot #'exp :region `(0 4))

  ;; default region is '(0 1)

  (plot #'sin)