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 |
The Operative System used by the user. You should not bind It directly, use the with-gnuplot macro instead.
Runs gnuplot as a subprocess. This should be the first function to call.
Shows a function. It can show functions like f(x) (2D representation) or g(x,y) (3D representation)
This functions shows scatter plots, with x and y errors if desired
Sends the graphic to the printer. You must specify which os you're using: w32 for Windows, unix for others.
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