All Manuals > CAPI User Guide and Reference Manual > 23 LW-GT Reference Entries

NextPrevUpTopContentsIndex

generate-graph-from-pairs

Function
Summary

Generates a drawing object which draws lines connecting points.

Package

lw-gt

Signature

generate-graph-from-pairs x-y-pairs &key thickness color x-offset y-offset x-scale y-scale => drawing-object

Arguments

x-y-pairs

A list.

thickness

A positive real number.

color

A Color specification.

x-offset , y-offset

Non-negative real numbers.

x-scale , y-scale

Positive real numbers.

Values

drawing-object

A drawing-object.

Description

The function generate-graph-from-pairs generates a "graph", which is a drawing object which draws lines connecting the points in the x-y-pairs argument.

x-y-pairs must be a list where each element is a list of length 2 specifying a point as a pair of coordinates ( x , y ).

x-scale , y-scale , x-offset and y-offset are used to scale and offset the graph. Each x value is multiplied by x-scale and then x-offset is added, and similarly for the y value. The default value of both x-offset and y-offset is 0. The default value of both x-scale and y-scale is 1.

The line is drawn with the thickness argument and color as the foreground color. The thickness is not scaled (it passes :scale-thickness nil to make-draw-lines). The default value of color is :red. The default value of thickness is 1.

Notes

generate-graph-from-pairs is a quite thin interface on top of make-draw-lines. If it does not do what you want, you can easily replace it by your own code.

See also

generate-graph-from-graph-spec
drawing-object
Higher level - drawing graphs and bar charts


CAPI User Guide and Reference Manual (Windows version) - 3 Aug 2017

NextPrevUpTopContentsIndex