cgn

Function summary
close-gnuplot
format-gnuplot text
load-cgn file
plot-function funcio
plot-points x y &key x_error y_error
postscript-copy filename
print-graphic &optional (os *os*)
replot-function funcio
save-cgn file
set-grid on-off
set-range eix min max
set-title text
start-gnuplot &optional (path "gnuplot")
update
Macro summary
with-gnuplot (os &key (path "gnuplot")) &body body
CGN    [Package]

cgn is a library to control gnuplot from inside Common Lisp.

*gnuplot*    [Variable]

Gnuplot's connection

*os*    [Variable]

The Operative System used by the user. You should not bind It directly, use the with-gnuplot macro instead.

start-gnuplot   &optional (path "gnuplot")  [Function]

Runs gnuplot as a subprocess. This should be the first function to call.

format-gnuplot   text  [Function]

Sends a command to gnuplot

close-gnuplot    [Function]

Closes gnuplot

update    [Function]

Refreshes the screen. This should not be called by the user.

set-title   text  [Function]

Sets the window title

set-grid   on-off  [Function]

Activates/deactivates the grid.

plot-function   funcio  [Function]

Shows a function. It can show functions like f(x) (2D representation) or g(x,y) (3D representation)

replot-function   funcio  [Function]

Shows a n-variable function on gnuplot / replot version. '

set-range   eix min max  [Function]

Sets the x or y range

plot-points   x y &key x_error y_error  [Function]

This functions shows scatter plots, with x and y errors if desired

postscript-copy   filename  [Function]

Saves a postscript copy of the screen .

print-graphic   &optional (os *os*)  [Function]

Sends the graphic to the printer. You must specify which os you're using: w32 for Windows, unix for others.

save-cgn   file  [Function]

Saves the screen to a file that can be loaded by gnuplot using load.

load-cgn   file  [Function]

Loads a file saved previously with save.

with-gnuplot   (os &key (path "gnuplot")) &body body  [Macro]

Creates a new gnuplot connection, and evaluates body. New from cgn 007.

This macro takes care of always having a running connection when you try to comunicate with gnuplot, and to close the connection when you finish using It. Also binds the *os* special variable to the os paramether in order to not having to pass It to the methods that are os-dependents (at the moment, only print-graphic). You can too specify the path where gnuplot resides ( pgnuplot.exe, on Windows ). This can be useful if you don't have gnuplot at the path. This is a tipical Windows problem.

At the moment, it asks you to introduce 'finish when the body has reached the end, because It doesn't have to close the connection before you want to finish seeing the results.

This should be the prefered way to use cgn. But you can continue opening and closing the connection manually. Just keep using (start-gnuplot) and (close-gnuplot) for that. I don't recommend to do that.

E.g : supose you want to print cos(x)*atan ( exp (y)) on a linux machine. You should use :

(with-gnuplot ( 'linux )

(plot-function "cos(x)* atan (exp(y)) " )

(print-graphic))

And you'll see:

==> Please, intro 'finish to finish the gnuplot session ... 'finish