plot

An interface to the GNU libplot library.

  1. plot
  2. Usage
  3. Documentation
    1. Version Information
    2. Data Types and Constructors
      1. Plotter Types
      2. Plotter Parameters
      3. Text Justification
      4. Line Styles
      5. Marker Styles
      6. Line Cap Styles
      7. Fill Modes
      8. Join Styles
      9. Drawing Direction
    3. Parameter Management
    4. Creating and Deleting Plotters
    5. Control Functions
    6. Object Drawing Functions
      1. Lines and Paths
      2. Points
      3. Rectangles
      4. Circles
      5. Ellipses
      6. Arcs
      7. Bezier Curves
      8. Text Labels
    7. Attribute-Setting Functions
      1. Colors
      2. Line Attributes
      3. Fill Attributes
      4. Text Attributes
      5. Drawing Modes
    8. State Management
    9. Coordinate Transformation Functions
  4. Examples
    1. Basic Example: C Curve
    2. Multiple Shapes Example
    3. Animated GIF Example
  5. Notes
  6. About this egg
    1. Author
    2. Version history
    3. License

Usage

(import plot)

Documentation

libplot is a part of the GNU plotutils package. It is a 2-D vector graphics library capable of exporting to many file formats, both vector and raster.

The Chicken plot library provides a Scheme interface to a large subset of the libplot procedures. This interface follows closely the libplot API, so the main reference is the plotutils manual.

In libplot, function names are of the form pl_function_r. The Scheme corresponding function name is function.

Below is a list of procedures that are included in this egg, along with brief descriptions. This egg has been tested with plotutils version 2.6.

Version Information

[procedure] (libplot-version) → string

Returns the version string of the underlying libplot library.

Data Types and Constructors

Plotter Types

[record] plotter-type

An algebraic datatype representing the type of plotter to create. Each plotter type corresponds to a different output format. Constructors include:

(X)
X Window System display
(PNG)
Portable Network Graphics (raster)
(PNM)
Portable Anymap format (raster)
(GIF)
Graphics Interchange Format (raster)
(SVG)
Scalable Vector Graphics (vector)
(AI)
Adobe Illustrator format (vector)
(PS)
PostScript (vector)
(CGM)
Computer Graphics Metafile (vector)
(FIG)
XFIG format (vector)
(PCL)
HP PCL format
(HPGL)
HP-GL/2 format (vector)
(REGIS)
ReGIS graphics format
(TEK)
Tektronix format
(META)
GNU metafile format (vector)
[procedure] (plotter-type? obj) → boolean

Returns #t if obj is a plotter-type value, #f otherwise.

Plotter Parameters

[record] plotter-parameter

An algebraic datatype representing configuration parameters for plotters. Each constructor takes one or more arguments to specify the parameter value.

Common Parameters (apply to most or all plotter types):

(DISPLAY string)
X Window System display name (X plotter only)
(BITMAPSIZE string)
Size specification for bitmap plotters (e.g., "800x600")
(PAGESIZE string)
Page size for vector plotters (e.g., "letter", "A4", "11x17in")
(ROTATION string)
Rotation angle in degrees (e.g., "0", "90", "180", "270")
(BG_COLOR string)
Background color name (e.g., "white", "black")
(EMULATE_COLOR boolean)
Whether to emulate color on monochrome devices
(MAX_LINE_LENGTH integer)
Maximum line segment length for path approximation
(INTERLACE boolean)
Whether to use interlaced format (GIF, PNG)
(TRANSPARENT_COLOR string)
Color to treat as transparent (GIF, PNG)

Plotter-Specific Parameters:

(CGM_ENCODING string)
CGM encoding type ("clear_text" or "binary")
(CGM_MAX_VERSION string)
Maximum CGM version (e.g., "1", "2", "3", "4")
(GIF_ANIMATION boolean)
Whether to produce animated GIF
(GIF_DELAY integer)
Frame delay in hundredths of a second for animated GIFs
(GIF_ITERATIONS integer)
Number of times to loop animation (0 = infinite)
(HPGL_ASSIGN_COLORS boolean)
Whether to assign pen colors automatically
(HPGL_OPAQUE_MODE boolean)
Whether to use opaque drawing mode
(HPGL_PENS string)
Number of pens to use
(HPGL_ROTATE string)
Rotation angle for HPGL output
(HPGL_VERSION string)
HPGL version ("1", "1.5", or "2")
(META_PORTABLE boolean)
Whether to use portable metafile format
(PCL_ASSIGN_COLORS boolean)
Whether to assign colors automatically
(PCL_BEZIERS boolean)
Whether to use native Bezier curve support
(PNM_PORTABLE boolean)
Whether to use ASCII (portable) PNM format
(TERM string)
Terminal type for display
(USE_DOUBLE_BUFFERING boolean)
Whether to use double buffering (X plotter)
(VANISH_ON_DELETE boolean)
Whether window vanishes when plotter deleted (X)
(X_AUTO_FLUSH boolean)
Whether to flush X display automatically
[procedure] (plotter-parameter? obj) → boolean

Returns #t if obj is a plotter-parameter value, #f otherwise.

Text Justification

[record] h-justify

Horizontal text justification. Constructors:

(Left)
Left-aligned text
(HCenter)
Horizontally centered text
(Right)
Right-aligned text
[procedure] (h-justify? obj) → boolean

Returns #t if obj is a horizontal justification value.

[record] v-justify

Vertical text justification. Constructors:

(Bottom)
Align to bottom of bounding box
(Baseline)
Align to text baseline
(VCenter)
Vertically centered
(Cap-line)
Align to capital letter height
(Top)
Align to top of bounding box
[procedure] (v-justify? obj) → boolean

Returns #t if obj is a vertical justification value.

Line Styles

[record] linetype

Line drawing styles. The following constructors are exported directly as values:

Solid
Solid line
Dotted
Dotted line
Dotdashed
Alternating dots and dashes
Shortdashed
Short dashes
Longdashed
Long dashes

Additional line types (not exported but available via the linetype datatype):

Dotdotdashed
Two dots followed by a dash
Dotdotdotdashed
Three dots followed by a dash
Disconnected
Disconnected line segments

Marker Styles

[record] marker

Point marker styles for plotting discrete points. Constructors:

No-marker
No marker drawn
Dot
Small dot
Plus
Plus sign (+)
Asterisk
Asterisk (*)
Circle
Circle outline
Cross
X-shaped cross
Square
Square outline
Triangle
Upward-pointing triangle
Diamond
Diamond shape
Star
Five-pointed star
Inv-triangle
Downward-pointing triangle
Starburst
Multi-pointed starburst
[procedure] (marker? obj) → boolean

Returns #t if obj is a marker value.

Line Cap Styles

[record] capmod

Line endpoint cap styles. Constructors:

Butt
Square butt caps (default)
CRound
Rounded caps
Projecting
Projecting square caps
Triangular
Triangular caps
[procedure] (capmod? obj) → boolean

Returns #t if obj is a cap mode value.

Fill Modes

[record] fillmod

Polygon fill rule modes. Constructors:

Alternate
Alternate winding rule
Winding
Non-zero winding rule
[procedure] (fillmod? obj) → boolean

Returns #t if obj is a fill mode value.

Join Styles

[record] joinmod

Line segment join styles. Constructors:

Miter
Mitered joins (default)
JRound
Rounded joins
Bevel
Beveled joins
[procedure] (joinmod? obj) → boolean

Returns #t if obj is a join mode value.

Drawing Direction

[record] direction

Arc and ellipse drawing direction. Constructors:

Clockwise
Draw in clockwise direction
Counterclockwise
Draw in counterclockwise direction
[procedure] (direction? obj) → boolean

Returns #t if obj is a direction value.

Parameter Management

[procedure] (params-new) → plotter-params

Creates a new plotter parameter structure. This structure must be passed to make-plotter and should be deleted with params-delete after the plotter is created.

[procedure] (params-delete params) → void

Deletes a plotter parameter structure and frees associated resources.

[procedure] (params-copy params) → plotter-params

Creates a copy of an existing plotter parameter structure.

[procedure] (param-set params parameter) → void

Sets a parameter in a plotter parameter structure. The parameter argument must be a plotter-parameter value created with one of the constructors described above.

Example:

(param-set params (PAGESIZE "A4"))
(param-set params (INTERLACE #t))
[procedure] (param-unset params parameter) → void

Unsets (removes) a parameter from a plotter parameter structure.

Creating and Deleting Plotters

[procedure] (make-plotter type out params #!key err) → plotter

Creates and initializes a new plotter.

type
A plotter-type value specifying the output format
out
Output port for plotter graphics data
params
List of plotter-parameter values for configuration
err
Optional error output port (keyword argument)

Returns a plotter object. The parameter list is processed internally, so you don't need to manage the parameter structure manually.

Example:

(define plotter 
  (make-plotter (PNG) 
                (open-output-file "output.png")
                (list (PAGESIZE "A4") 
                      (INTERLACE #t)
                      (BG_COLOR "white"))))
[procedure] (delete-plotter plotter) → void

Deletes a plotter and frees all associated resources. The plotter should not be used after deletion.

Control Functions

[procedure] (openpl plotter) → void

Opens a plotter for drawing. This must be called before any drawing operations.

[procedure] (closepl plotter) → void

Closes a plotter and finalizes output. After closing, openpl can be called again to start a new page or frame.

[procedure] (erase plotter) → void

Erases the current drawing surface, filling it with the background color.

[procedure] (space plotter x0 y0 x1 y1) → void

Sets the coordinate system using integer coordinates. The rectangle from (x0, y0) to (x1, y1) in user coordinates is mapped to the plotter's drawable region.

[procedure] (fspace plotter x0 y0 x1 y1) → void

Sets the coordinate system using floating-point coordinates. This is the floating-point version of space.

[procedure] (space2 plotter x0 y0 x1 y1 x2 y2) → void

Sets up a coordinate system with an arbitrary affine transformation using integer coordinates. Maps (x0, y0) to the lower-left and (x1, y1) to the lower-right of the drawable region, with (x2, y2) specifying the vertical extent.

[procedure] (fspace2 plotter x0 y0 x1 y1 x2 y2) → void

Floating-point version of space2.

[procedure] (bgcolorname plotter color-name) → void

Sets the background color by name (e.g., "white", "black", "red"). Takes effect on the next erase operation.

[procedure] (havecap plotter capability) → boolean

Tests whether the plotter has a specific capability. Returns #t if the capability is supported, #f otherwise.

[procedure] (flushpl plotter) → void

Flushes drawing output to the output stream. This is primarily useful for X Window and interactive plotters.

Object Drawing Functions

Lines and Paths

[procedure] (move plotter x y) → void

Moves the graphics cursor to position (x, y) using integer coordinates without drawing.

[procedure] (fmove plotter x y) → void

Moves the graphics cursor using floating-point coordinates.

[procedure] (moverel plotter dx dy) → void

Moves the graphics cursor relative to current position using integer offsets.

[procedure] (fmoverel plotter dx dy) → void

Moves the graphics cursor relative to current position using floating-point offsets.

[procedure] (cont plotter x y) → void

Continues the current path by drawing a line segment to (x, y) using integer coordinates.

[procedure] (fcont plotter x y) → void

Continues the current path using floating-point coordinates.

[procedure] (contrel plotter dx dy) → void

Continues the current path with a relative line segment using integer offsets.

[procedure] (fcontrel plotter dx dy) → void

Continues the current path with a relative line segment using floating-point offsets.

[procedure] (line plotter x0 y0 x1 y1) → void

Draws a line segment from (x0, y0) to (x1, y1) using integer coordinates.

[procedure] (fline plotter x0 y0 x1 y1) → void

Draws a line segment using floating-point coordinates.

[procedure] (linerel plotter dx0 dy0 dx1 dy1) → void

Draws a line segment using relative integer coordinates from current position.

[procedure] (flinerel plotter dx0 dy0 dx1 dy1) → void

Draws a line segment using relative floating-point coordinates.

[procedure] (endpath plotter) → void

Ends the current path, drawing and/or filling it according to current attributes.

[procedure] (endsubpath plotter) → void

Ends the current subpath within a compound path.

[procedure] (closepath plotter) → void

Closes the current path by drawing a line segment back to the starting point.

Points

[procedure] (point plotter x y) → void

Draws a point or marker at (x, y) using integer coordinates.

[procedure] (fpoint plotter x y) → void

Draws a point or marker using floating-point coordinates.

[procedure] (pointrel plotter dx dy) → void

Draws a point or marker at a relative position using integer offsets.

[procedure] (fpointrel plotter dx dy) → void

Draws a point or marker at a relative position using floating-point offsets.

[procedure] (marker plotter x y type size) → void

Draws a marker of specified type and size at (x, y) using integer coordinates. The type should be a marker value.

[procedure] (fmarker plotter x y type size) → void

Draws a marker using floating-point coordinates.

[procedure] (markerrel plotter dx dy type size) → void

Draws a marker at a relative position using integer offsets.

[procedure] (fmarkerrel plotter dx dy type size) → void

Draws a marker at a relative position using floating-point offsets.

Rectangles

[procedure] (box plotter x0 y0 x1 y1) → void

Draws a rectangle from (x0, y0) to (x1, y1) using integer coordinates. The rectangle is drawn and/or filled according to current pen and fill attributes.

[procedure] (fbox plotter x0 y0 x1 y1) → void

Draws a rectangle using floating-point coordinates.

[procedure] (boxrel plotter dx0 dy0 dx1 dy1) → void

Draws a rectangle using relative integer coordinates from the current position.

[procedure] (fboxrel plotter dx0 dy0 dx1 dy1) → void

Draws a rectangle using relative floating-point coordinates.

Circles

[procedure] (circle plotter x y radius) → void

Draws a circle centered at (x, y) with the specified radius using integer coordinates.

[procedure] (fcircle plotter x y radius) → void

Draws a circle using floating-point coordinates.

[procedure] (circlerel plotter dx dy radius) → void

Draws a circle at a position relative to the current point using integer offsets.

[procedure] (fcirclerel plotter dx dy radius) → void

Draws a circle at a relative position using floating-point offsets.

Ellipses

[procedure] (ellipse plotter x y rx ry angle) → void

Draws an ellipse centered at (x, y) with semi-axes rx and ry, rotated by angle degrees, using integer coordinates.

[procedure] (fellipse plotter x y rx ry angle) → void

Draws an ellipse using floating-point coordinates.

[procedure] (ellipserel plotter dx dy rx ry angle) → void

Draws an ellipse at a relative position using integer coordinates.

[procedure] (fellipserel plotter dx dy rx ry angle) → void

Draws an ellipse at a relative position using floating-point coordinates.

Arcs

[procedure] (arc plotter xc yc x0 y0 x1 y1) → void

Draws a circular arc from point (x0, y0) to (x1, y1), with center at (xc, yc), using integer coordinates.

[procedure] (farc plotter xc yc x0 y0 x1 y1) → void

Draws a circular arc using floating-point coordinates.

[procedure] (arcrel plotter dxc dyc dx0 dy0 dx1 dy1) → void

Draws a circular arc using relative integer coordinates.

[procedure] (farcrel plotter dxc dyc dx0 dy0 dx1 dy1) → void

Draws a circular arc using relative floating-point coordinates.

[procedure] (ellarc plotter xc yc x0 y0 x1 y1) → void

Draws an elliptic arc using integer coordinates. The arc is part of the ellipse that would pass through all three specified points.

[procedure] (fellarc plotter xc yc x0 y0 x1 y1) → void

Draws an elliptic arc using floating-point coordinates.

[procedure] (ellarcrel plotter dxc dyc dx0 dy0 dx1 dy1) → void

Draws an elliptic arc using relative integer coordinates.

[procedure] (fellarcrel plotter dxc dyc dx0 dy0 dx1 dy1) → void

Draws an elliptic arc using relative floating-point coordinates.

Bezier Curves

[procedure] (bezier2 plotter x0 y0 x1 y1 x2 y2) → void

Draws a quadratic Bezier curve with control points (x0, y0), (x1, y1), and (x2, y2) using integer coordinates.

[procedure] (fbezier2 plotter x0 y0 x1 y1 x2 y2) → void

Draws a quadratic Bezier curve using floating-point coordinates.

[procedure] (bezier2rel plotter dx0 dy0 dx1 dy1 dx2 dy2) → void

Draws a quadratic Bezier curve using relative integer coordinates.

[procedure] (fbezier2rel plotter dx0 dy0 dx1 dy1 dx2 dy2) → void

Draws a quadratic Bezier curve using relative floating-point coordinates.

[procedure] (bezier3 plotter x0 y0 x1 y1 x2 y2 x3 y3) → void

Draws a cubic Bezier curve with control points (x0, y0), (x1, y1), (x2, y2), and (x3, y3) using integer coordinates.

[procedure] (fbezier3 plotter x0 y0 x1 y1 x2 y2 x3 y3) → void

Draws a cubic Bezier curve using floating-point coordinates.

[procedure] (bezier3rel plotter dx0 dy0 dx1 dy1 dx2 dy2 dx3 dy3) → void

Draws a cubic Bezier curve using relative integer coordinates.

[procedure] (fbezier3rel plotter dx0 dy0 dx1 dy1 dx2 dy2 dx3 dy3) → void

Draws a cubic Bezier curve using relative floating-point coordinates.

Text Labels

[procedure] (label plotter text) → void

Draws a text label at the current position. The text is positioned according to the current text justification settings.

[procedure] (alabel plotter h-justify v-justify text) → void

Draws a text label with explicit horizontal and vertical justification. h-justify should be an h-justify value and v-justify should be a v-justify value.

Example:

(alabel plotter (HCenter) (Baseline) "Centered Text")

Attribute-Setting Functions

Colors

[procedure] (color plotter red green blue) → void

Sets both pen and fill color using RGB values (0-65535 range). This is equivalent to calling both pencolor and fillcolor.

[procedure] (pencolor plotter red green blue) → void

Sets the pen (drawing) color using RGB values.

[procedure] (fillcolor plotter red green blue) → void

Sets the fill color using RGB values.

[procedure] (bgcolor plotter red green blue) → void

Sets the background color using RGB values. Takes effect on next erase operation.

[procedure] (colorname plotter color-name) → void

Sets both pen and fill color by name (e.g., "red", "blue", "#FF0000").

[procedure] (pencolorname plotter color-name) → void

Sets the pen color by name.

[procedure] (fillcolorname plotter color-name) → void

Sets the fill color by name.

Line Attributes

[procedure] (linewidth plotter width) → void

Sets the line width in user coordinates using an integer value.

[procedure] (flinewidth plotter width) → void

Sets the line width in user coordinates using a floating-point value.

[procedure] (linemod plotter line-type) → void

Sets the line style. line-type should be one of the exported line type values: Solid, Dotted, Dotdashed, Shortdashed, or Longdashed.

Example:

(linemod plotter Dotted)
[procedure] (linedash plotter dashes offset) → void

Sets a custom dash pattern. dashes is a list of integers specifying dash and gap lengths in user coordinates. offset is an integer offset into the pattern.

Example:

(linedash plotter '(10 5 5 5) 0)  ; long dash, gap, short dash, gap
[procedure] (flinedash plotter dashes offset) → void

Sets a custom dash pattern using floating-point values.

[procedure] (capmod plotter cap-style) → void

Sets the line cap style. cap-style should be a capmod value.

[procedure] (joinmod plotter join-style) → void

Sets the line join style. join-style should be a joinmod value.

[procedure] (fmiterlimit plotter limit) → void

Sets the miter limit for mitered line joins. The limit is the maximum ratio of miter length to line width before the join is beveled instead.

Fill Attributes

[procedure] (filltype plotter fill-fraction) → void

Sets the fill level. fill-fraction is an integer from 0 (no fill) to 65535 (solid fill), controlling the density of the fill pattern.

[procedure] (fillmod plotter fill-mode) → void

Sets the fill rule. fill-mode should be a fillmod value.

Text Attributes

[procedure] (fontname plotter font-name) → void

Sets the current font by name (e.g., "Helvetica", "Times-Roman").

[procedure] (fontsize plotter size) → void

Sets the font size in user coordinates using an integer value.

[procedure] (ffontsize plotter size) → void

Sets the font size using a floating-point value.

[procedure] (textangle plotter angle) → void

Sets the text rotation angle in degrees using an integer value.

[procedure] (ftextangle plotter angle) → void

Sets the text rotation angle using a floating-point value.

[procedure] (labelwidth plotter text) → integer

Returns the width of a text label in user coordinates as an integer.

[procedure] (flabelwidth plotter text) → float

Returns the width of a text label in user coordinates as a floating-point value.

Drawing Modes

[procedure] (pentype plotter pen-type) → void

Sets the pen type (0 = no drawing, 1 = normal drawing).

[procedure] (orientation plotter direction) → void

Sets the path orientation. direction should be a direction value.

State Management

[procedure] (savestate plotter) → void

Saves the current graphics state (colors, line styles, fonts, etc.) onto an internal stack.

[procedure] (restorestate plotter) → void

Restores the most recently saved graphics state from the internal stack.

Coordinate Transformation Functions

[procedure] (fsetmatrix plotter m0 m1 m2 m3 m4 m5) → void

Sets the transformation matrix directly. The matrix maps user coordinates (x, y) to device coordinates using:

x' = m0*x + m2*y + m4
y' = m1*x + m3*y + m5
[procedure] (fconcat plotter m0 m1 m2 m3 m4 m5) → void

Concatenates (multiplies) the current transformation matrix with the specified matrix.

[procedure] (frotate plotter angle) → void

Rotates the coordinate system by angle degrees around the origin.

[procedure] (fscale plotter sx sy) → void

Scales the coordinate system by factors sx horizontally and sy vertically.

[procedure] (ftranslate plotter dx dy) → void

Translates the coordinate system by (dx, dy).

Examples

Basic Example: C Curve

(import plot)

(define (ccurve plotter maxorder dx dy order)
  (if (>= order maxorder)
      (fcontrel plotter dx dy)
      (begin
        (ccurve plotter maxorder
                (* 0.5 (- dx dy))
                (* 0.5 (+ dx dy))
                (+ order 1))
        (ccurve plotter maxorder
                (* 0.5 (+ dy dx))
                (* 0.5 (- dy dx))
                (+ order 1)))))

(define (simple-test plotter max-order)
  (openpl plotter)
  (fspace plotter 0. 0. 1000. 1000.)
  (flinewidth plotter 0.25)
  (pencolorname plotter "blue")
  (erase plotter)
  (fmove plotter 600. 300.)
  (ccurve plotter max-order 0. 400. 0)
  (closepl plotter))

(define (main)
  (print "libplot version: " (libplot-version))
  (let ((plotter (make-plotter (PNG) 
                               (open-output-file "testplot.png") 
                               (list (PAGESIZE "A4") 
                                     (INTERLACE #t)
                                     (X_AUTO_FLUSH #f) 
                                     (META_PORTABLE #t)))))
    (simple-test plotter 5)
    (delete-plotter plotter)))

(main)

Multiple Shapes Example

(import plot)

(define (draw-shapes plotter)
  (openpl plotter)
  (fspace plotter 0.0 0.0 400.0 400.0)
  (erase plotter)
  
  ; Red filled circle
  (pencolorname plotter "red")
  (fillcolorname plotter "pink")
  (filltype plotter 65535)
  (fcircle plotter 100.0 100.0 40.0)
  
  ; Blue dashed rectangle
  (pencolorname plotter "blue")
  (filltype plotter 0)
  (linemod plotter Dashed)
  (flinewidth plotter 2.0)
  (fbox plotter 200.0 50.0 300.0 150.0)
  
  ; Green triangle using path
  (pencolorname plotter "green")
  (fillcolorname plotter "lightgreen")
  (filltype plotter 32767)
  (linemod plotter Solid)
  (fmove plotter 150.0 250.0)
  (fcont plotter 250.0 250.0)
  (fcont plotter 200.0 350.0)
  (closepath plotter)
  (endpath plotter)
  
  ; Text label
  (pencolorname plotter "black")
  (fontname plotter "Helvetica-Bold")
  (ffontsize plotter 16.0)
  (alabel plotter (HCenter) (VCenter) "Shapes Demo")
  
  (closepl plotter))

(define plotter 
  (make-plotter (SVG) 
                (open-output-file "shapes.svg")
                (list (PAGESIZE "letter")
                      (BG_COLOR "white"))))

(draw-shapes plotter)
(delete-plotter plotter)

Animated GIF Example

(import plot)

(define (draw-frame plotter angle)
  (openpl plotter)
  (fspace plotter -150.0 -150.0 150.0 150.0)
  (erase plotter)
  
  (pencolorname plotter "blue")
  (flinewidth plotter 3.0)
  
  ; Rotating line
  (let ((x (* 100.0 (cos angle)))
        (y (* 100.0 (sin angle))))
    (fline plotter 0.0 0.0 x y))
  
  (closepl plotter))

(define (animate frames)
  (let ((plotter (make-plotter (GIF)
                               (open-output-file "animation.gif")
                               (list (BITMAPSIZE "300x300")
                                     (BG_COLOR "white")
                                     (GIF_ANIMATION #t)
                                     (GIF_DELAY 5)
                                     (GIF_ITERATIONS 0)))))
    (do ((i 0 (+ i 1)))
        ((>= i frames))
      (draw-frame plotter (* 2.0 3.14159 (/ i frames))))
    (delete-plotter plotter)))

(animate 36)  ; 36 frames for smooth rotation

Notes

About this egg

Author

Ivan Raikov

Version history

2.1-2.2
Ported to CHICKEN 5
1.1
Added matchable and datatype as dependencies (thanks to Mario Domenech Goulart)
1.0
Initial release

License

Copyright 2011-2026 Ivan Raikov.

Based on the Ocamlplot library by Olivier Andrieu.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

A full copy of the GPL license can be found at
<http://www.gnu.org/licenses/>.