3.2 The Plotting Library

The (plotutils plot) library contains drawing primitives.

There are two important types to note: <plotter> and <plparams>. Roughly speaking, <plparams> describes the surface on which you are drawing – its size and format – and <plotter> describes the state of the virtual pen being used to draw on that surface.

3.2.1 plparams procedures

Procedure: newplparams

This procedure returns a newly allocated <plparams> in a default state.

Procedure: setplparam! plparams parameter value

This procedure modifies the state of a <plparams> object. Both parameter and value are strings. For the available parameters and values See Plotter parameters.

3.3 plotter procedures

To make a new <plotter> which is on object that keeps the state of the “pen” being used to draw on a surface, use the procedure newpl.

Procedure: newpl type outp errp param

Creates a new <plotter> object. type is the output format that will result from this plotting: one of “X”, “png”, “svg”, “pcl”, “gif”, or “pnm”. Other options may be present depending on how libplot was compiled in the upstrem GNU Plotutils library.

outp and errp should be Guile output ports. outp will receive the output produced by the plotter in the format specified by type. errp will receive error messages.

param is an object of type <plparams> that has set up the “paper” upon which we are drawing.