Common Lisp Package: CGN

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

README:

FUNCTION

Public

ANIMATE-FUNCTION (FUNCTION &KEY VARIABLE INITIAL_VALUE INCREMENT NUMBER_OF_FRAMES RAPIDITY)

Animates function, changing the value of variable in increments of increment at velocity rapidity, until number_of_frames is reached. At the moment, only one paramether is permited.

CLOSE-GNUPLOT

Closes gnuplot

DISABLE-DEBUG

Disables debug for cgn.

ENABLE-DEBUG

Enables debug for cgn.

FORMAT-GNUPLOT (TEXT &REST ARGUMENTS)

Sends a command to gnuplot

LOAD-CGN (FILE)

Loads a file saved previously with save.

PLOT-FUNCTION (FUNCIO)

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

PLOT-POINTS (X Y &KEY X_ERROR Y_ERROR)

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

POSTSCRIPT-COPY (FILENAME)

Saves a postscript copy of the screen .

REPLOT-FUNCTION (FUNCIO)

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

SAVE-CGN (FILE)

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

SET-GRID (ON-OFF)

Activates/deactivates the grid.

SET-RANGE (EIX MIN MAX)

Sets the x or y range

SET-TITLE (TEXT)

Sets the window title

SHOW-RELEASE-INFO

Show the release info.

START-GNUPLOT (&OPTIONAL (PATH gnuplot))

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

Private

DATA-SERIE-ERROR_X (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DATA-SERIE-ERROR_Y (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DATA-SERIE-NIL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DATA-SERIE-TITLE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DATA-SERIE-X (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DATA-SERIE-Y (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SCATTER-GRAPHIC-NIL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SCATTER-GRAPHIC-SERIES (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SCATTER-GRAPHIC-TITLE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

UPDATE

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

Undocumented

COPY-DATA-SERIE (INSTANCE)

COPY-SCATTER-GRAPHIC (INSTANCE)

SETFDATA-SERIE-ERROR_X (NEW-VALUE INSTANCE)

SETFDATA-SERIE-ERROR_Y (NEW-VALUE INSTANCE)

SETFDATA-SERIE-NIL (NEW-VALUE INSTANCE)

DATA-SERIE-P (OBJECT)

SETFDATA-SERIE-TITLE (NEW-VALUE INSTANCE)

SETFDATA-SERIE-X (NEW-VALUE INSTANCE)

SETFDATA-SERIE-Y (NEW-VALUE INSTANCE)

MAKE-DATA-SERIE (&KEY ((NIL DUM0) NIL) ((X DUM1) NIL) ((Y DUM2) NIL) ((ERROR_X DUM3) NIL) ((ERROR_Y DUM4) NIL) ((TITLE DUM5) NIL))

MAKE-SCATTER-GRAPHIC (&KEY ((NIL DUM58) NIL) ((SERIES DUM59) NIL) ((TITLE DUM60) NIL))

SETFSCATTER-GRAPHIC-NIL (NEW-VALUE INSTANCE)

SCATTER-GRAPHIC-P (OBJECT)

SETFSCATTER-GRAPHIC-SERIES (NEW-VALUE INSTANCE)

SETFSCATTER-GRAPHIC-TITLE (NEW-VALUE INSTANCE)

MACRO

Public

WITH-GNUPLOT ((OS &KEY (PATH gnuplot)) &BODY BODY)

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

GENERIC-FUNCTION

Public

Undocumented

CREATE-SCATTER-DATA-SERIE (SC X Y ERROR_X ERROR_Y TITLE)

CREATE-SCATTER-GRAPHIC-DESCRIPTION (TITLE)

PLOT-SCATTER-GRAPHIC (SC)

VARIABLE

Private

*DEBUG*

A flag controlling if cgn has to do debug.

*GNUPLOT*

Gnuplot's connection

*OS*

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

*RELEASE*

The number of release.

Undocumented

*RELEASE-DATE*

CLASS

Private

Undocumented

DATA-SERIE

SCATTER-GRAPHIC