plot Module



(require iup/plot)
CHICKEN (require-extension iup-plot)

Plotting support. Initializes the IUP Plot library when loaded.

Plot Control

(plot #:<name> <value> ...) → ihandle?

Creates a plotting canvas.

Plotting Functions

(call-with-plot [handle ihandle?] [proc (-> ihandle? any)] #:x-string? [x-string? any/c #f]) → any

Calls the given procedure with the given plotting canvas handle and ensures that the canvas is ready to receive data in the given x-axis mode. Returns whatever the given procedure returns.

(plot-add! [handle ihandle?] [x (or/c string? real?)] [y real?] [sample-index (or/c integer? #f) #f] [index (or/c integer? #f) #f]) → void?

Adds a sample to the given plotting canvas. Whether x must be a string or a real number depends on the setting of the xdata-string? argument to the call-with-plot invocation that created the dataset.

If sample-index is #f, the sample is appended to the dataset and the call to plot-add! must be within the dynamic context of a call to call-with-plot.

If sample-index is a number, the sample is inserted into the dataset before the given sample index. The call to plot-add! does not have to be within the dynamic context of a call to call-with-plot in this case. The dataset to which the new sample should be added may be specified explicitly by its index through the index argument. If the index argument is false, the current dataset of the plotting canvas is used.

Auxiliary Functions

(plot-x/y->pixel-x/y [handle ihandle?] [x real?] [y real?]) → (values real? real?)

Transforms plot coordinates into pixel coordinates.

(plot-paint-to [handle ihandle?] [canvas canvas?]) → void?

Paints the plot's contents into a canvas other than the one belonging to the plot control itself. canvas should be a pointer to a canvas object created using the CD graphics library.