Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Common Lisp Emacs Lisp
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
documentation/developer-doc Cleaned up code and comments. Still using native calls for SBCL and C…

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:

(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

For passing complex gnuplot commands that consists of many lines, use the send-line and send-line-break commands

(do-stuff (action actions)
   (send-line (action->string action)))

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


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).

(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)


  • 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
Something went wrong with that request. Please try again.