Create a basic-graph-spec object.

lw-gt

make-basic-graph-spec `function` `start-x` `step-x` `range` &key `color` `thickness` `name` `x-offset` `y-offset` `x-scale` `y-scale` `var1` `var2` `var3` `var4` `var5` `var6` => `basic-graph-spec`

basic-graph-spec-p `object` => `boolean`

copy-basic-graph-spec `basic-graph-spec` => `basic-graph-spec`

generate-graph-from-graph-spec `basic-graph-spec` => `drawing-object`

function⇩ |
A function of two arguments x and y. |

Real numbers. | |

color⇩ |
A color specification in the Color system. |

thickness⇩ |
A positive real numbers. |

name⇩ |
A Lisp object. |

Real numbers. | |

Lisp objects. | |

object⇩ |
A Lisp object. |

basic-graph-spec⇩ |
A basic-graph-spec object. |

basic-graph-spec |
A basic-graph-spec object. |

boolean |
A boolean. |

drawing-object |

The function `make-basic-graph-spec`

creates a basic-graph-spec object. This object can be modified by the `basic-graph-spec-*`

accessors. The function `generate-graph-from-graph-spec`

generates the graph using the current values in the basic-graph-spec object, which is a drawing-object which when drawn draws the graph, which means drawing a line between each two successive points.

`function` must be a function of two arguments: the basic-graph-spec and the x value. It needs to return the corresponding y value.

`start-x`, `step-x` and `range` define which x values to use: the first value is `start-x`, and then increase by `step-x` until the x is greater than (+ `start-x` `range`). For each x value, `generate-graph-from-graph-spec`

calls `function` with `basic-graph-spec` and the x value to generate the y value.

`x-scale` and `y-scale` (default to 1) are used to scale the x and y after calling `function`, by multiplying the x and y by `x-scale` and `y-scale` respectively.

`x-offset` and `y-offset` (default to 0) are used to translate the scaled values of x and y by adding `x-offset` and `y-offset` to the scaled x and y.

The scaled and transformed pair x, y define a point. `generate-graph-from-graph-spec`

then generates a drawing-object that draws a line between each two successive points.

`thickness` and `color` specify the thickness and the color of the lines. The lines are drawn with `scale-thickness` `nil`

.

`name`, `var1`, `var2`, `var3`, `var4`, `var5` AND `var6` are arbitrary values, which you can use to store anything that the function needs to compute the y value. The system does not read or write them.

The function `copy-basic-graph-spec`

can be used to copy a `basic-graph-spec`.

The fimctopm `basic-graph-spec-p`

is the predicate, which returns true if `object` is a basic-graph-spec and false otherwise.

basic-graph-spec

generate-graph-from-pairs

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*