To use the histogram module in a S-lang script, it is first
necessary to make the functions in the package known to the
interpreter via
() = evalfile ("histogram");
or, if the application embedding the interpreter supports the
require function,
require ("histogram");
may be used. If there is a namespace conflict between symbols in the
script and those defined in the module, it may be necessary to load
the histogram package into a namespace, e.g.,
() = evalfile ("histogram", "hist");
will place the histogram symbols into a namespace called hist.
Once the histogram module has been loaded, functions defined by the it may be used in the usual way, e.g.,
require ("histogram");
.
.
h = hist1d (points, [min(points):max(points):0.1]);
where hist1d is the 1-d histogram function.