plot.ss: Plot
To load: (require (lib "plot.ss" "mrlib"))
The plot.ss library provides a simple tool for plotting data values to a device context.
Two structures are provided: data-set
and plot-setup.
A data-set value includes the following fields (which should
be supplied on order to make-data-set):
points:(listof (is-a?/c-- the data values to plot.point%))connected?:any?-- indicates whether the points are connected by a line.pen:(is-a?/c-- the drawing pen for plotting points/lines.pen%)min-x:number?,max-x:number?,min-y:number?, andmax-y:number?-- the to plot the points, in drawing-context coordinates.
A plot-setup value includes the following fields (which
should be supplied on order to plot-setup):
axis-label-font:(is-a?/c-- the font for drawing axis labels.font%)axis-number-font:(is-a?/c-- the font for drawing axis numbers.font%)axis-pen:(is-a?/c-- the pen for drawing the axes.pen%)grid?:any?-- whether to draw a grid at axis markings.grid-pen:(is-a?/cthe pen for drawing the grid (if any).pen%)x-axis-marking:(listof number?)-- locations for marks on the x-axis.y-axis-marking:(listof number?)-- locations for marks on the y-axis.x-axis-label:string?-- the x-axis label.y-axis-label:string?-- the y-axis label.
(plot dc data-set-list plot-setup) PROCEDURE
Draws the data-sets in data-set-list into the
given dc. Uses drawing-context coordinates
in data-sets that will accommodate all of the data sets.