Generates a drawing object which draws lines connecting points.

lw-gt

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

x-y-pairs⇩ |
A list. |

thickness⇩ |
A positive real number. |

color⇩ |
A Color specification. |

Non-negative real numbers. | |

Positive real numbers. |

drawing-object |

The function `generate-graph-from-pairs`

generates a "graph", which is a drawing object which draws lines connecting the points in `x-y-pairs`.

`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.

`thickness` specifies the thickness of the line, which is not scaled (it passes `:scale-thickness nil`

to make-draw-lines). `thickness` defaults to 1.

`color` specifies the foreground color of the line `color` defaults to `:red`

.

`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.

generate-graph-from-graph-spec

drawing-object

14.2 Higher level - drawing graphs and bar charts

*CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:48*