Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
Plot5Streams


NAME

Plot5Streams - traditional Berkeley plot streams

SYNOPSIS

PROCEDURE Create(VAR plotter: Plotters.Plotter; out: Streams.Stream);

DESCRIPTION

Plot5Streams provides an implementation of Plotters that generates traditional Berkeley plot streams. Independent from the current architecture, all binary numbers are generated in little-endian format.

Some options for viewing Berkeley plot streams:

Create creates a plotter that generates the Berkeley plot instructions onto out. The plotter acts as forwarding object in the sense of Forwarders, i.e. the plotter dies if out terminates, and error events of out are forwarded to plotter.

DIAGNOSTICS

All error events generated by the underlying stream are forwarded to the plotter object. In case of failures, all subsequent operations are silently suppressed.

EXAMPLE

Following procedure opens a plot stream that sends all plot instructions to the plot(1) utility using a pipeline:
PROCEDURE CreateXPlotter(VAR plotter: Plotters.Plotter;
                         errors: RelatedEvents.Object) : BOOLEAN;
   VAR
      out: Streams.Stream;
BEGIN
   IF ~UnixPipes.Open(out, "/usr/local/bin/plot -l -T X",
         UnixPipes.write, Streams.onebuf, errors) THEN
      RETURN FALSE
   END;
   Plot5Streams.Create(plotter, out);
END CreateXPlotter;
Note that out is automatically closed as soon as plotter closes because plotter is the only object that references out.

SEE ALSO

plot(1)
GNU plot utility
plot(1b)
traditional BSD plot utility
postplot(1)
Solaris plot stream to PostScript converter
Plotters
general interface for simple plotters

BUGS

Note that different plot utilities come with different interpretations and different bugs. GNU plot(1), for example, redefines the current position after drawing an arc while postplot(1) does not change it.
Edited by: borchert, last change: 2004/04/22, revision: 1.2, converted to HTML: 2004/04/22

Oberon || Library || Module Index || Search Engine || Definition || Module