The graphics.cpl library provides basic plotting instructions by linking a CPL program to GNU plotutils.
The same programming interface is also shared by nographics and gnuplot
Starts a new graph, or clears a previously existing one. If the argument <filename> is specified, the graph is simultaneously piped to the screen and to a file of graphics commands that allows the graph to be reproduced later. If the argument <n> is specified (available in the gnuplot version only) a new window numbered <n> is opened and the previous graph window is left on screen.
Most graphics commands invoke OPENGRAPH() automatically if no graph was previously opened.
SUBROUTINE CLOSEGRAPH()
closes a graphics window (not necessary when opening a new one).
specifies a plotting window within the current graph, in a system of coordinates going from 0 to 1 along either axis.
If WINDOW was not specified, 0,1,0,1 is assumed.
specify a range for the drawing coordinates on either axis, and possibly a mapping function (system- or user-provided). For example:
RANGE(0,100,-1,2.5)
RANGE(1,100,LOG,0,10,LIN)
The predefined function LIN provides a linear identity mapping. The current range may be read from the
REAL CONSTANT XMIN,XMAX,YMIN,YMAX
If RANGE was not specified, 0,1,0,1 is assumed (except for PLOT).
Starts a new line (chain of segments) within the current graph. That is, the next DRAW command will not draw a segment but just a point.
STARTCIRCLE specifies that a small circle be drawn in each point rather than connecting them with segments. In the gnuplot version only, the argument <style> may be added to specify a gnuplot-recognized line style.
plot first versus second function over an array of points
SUBROUTINE PLOT(REAL FUNCTION(INTEGER n) fy; ARRAY(∗) OF REAL vecx)
plot real function over an array of points
SUBROUTINE PLOT(REAL FUNCTION(REAL x) f; REAL x1..x2)
plot real function over real interval
SUBROUTINE PLOT(REAL FUNCTION(REAL x) f)
plot real function over preset interval
SUBROUTINE PLOT(ARRAY(∗) OF REAL vec)
plot real array versus its index
SUBROUTINE PLOT(ARRAY(∗) OF INTEGER vec)
plot integer array versus its index
SUBROUTINE PLOT(ARRAY(∗) OF REAL vecy,vecx)
plot first versus second array
SUBROUTINE PLOT(ARRAY(∗) OF REAL vecy; ARRAY(∗) OF INTEGER vecx)
plot first versus second array
These subroutines have the purpose of plotting a function or data array in a predefined format with a single command. If a RANGE was not specified between OPENGRAPH and the current PLOT, it is automatically determined. As a more flexible alternative the plot command is also available which more directly mimics, and offers all the options of, gnuplot's plot.
This library provides the same plotting instructions as graphics.cpl but pipes the appropriate commands to a gnuplot process.
In addition the following commands are available in gnuplot.cpl only: