Skip to content

mirkov/gnuplot-interface

Repository files navigation

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)))
(sent-line-break)

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

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

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

Watchers

Forks

Releases

No releases published

Packages

No packages published