Page: (graphics)Top, Next: nographics, Prev: (matrix), Up: (cpl)Library

## Plotting library

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

Page: (graphics)OPENGRAPH, Next: WINDOW, Prev: Top, Up: Top

### SUBROUTINE OPENGRAPH()

### SUBROUTINE OPENGRAPH(STRING filename)

### SUBROUTINE OPENGRAPH(INTEGER n)

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.
A graphics window may be closed without opening a new one by the
### SUBROUTINE CLOSEGRAPH()

Page: (graphics)WINDOW, Next: RANGE, Prev: OPENGRAPH, Up: Top

### SUBROUTINE WINDOW(REAL VARIABLE x1, x2, y1, y2)

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.

Page: (graphics)RANGE, Next: STARTLINE, Prev: WINDOW, Up: Top

### SUBROUTINE RANGE(REAL x1,x2; FUNCTION(REAL z)->REAL newxmap; REAL y1,y2; FUNCTION(REAL z)->REAL newymap)

### SUBROUTINE RANGE(REAL x1,x2,y1,y2)

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).

Page: (graphics)STARTLINE, Next: DRAW, Prev: RANGE, Up: Top

### SUBROUTINE STARTLINE()

### SUBROUTINE STARTCIRCLE()

### SUBROUTINE STARTLINE(ARRAY(∗) OF CHAR style)

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.

Page: (graphics)DRAW, Next: LABEL, Prev: STARTLINE, Up: Top

### SUBROUTINE DRAW(REAL x,y)

The basic drawing primitive, draws a line segment up to point <x>, <y> or a symbol according to the style specified by STARTLINE.
### SUBROUTINE MOVE(REAL x,y)

is equivalent to STARTLINE; DRAW x,y
### SUBROUTINE LINE(REAL x1,y1,x2,y2)

is equivalent to STARTLINE; DRAW x1,y1; DRAW x2,y2
### SUBROUTINE BOX(REAL x1,x2,y1,y2)

### SUBROUTINE CIRCLE(REAL x,y,r)

do what their names imply.

Page: (graphics)LABEL, Next: SHOWGRAPH, Prev: DRAW, Up: Top

### SUBROUTINE LABEL(REAL x,y; POINTER TO CSTRING s)

writes character string <s> starting at coordinates <x>, <y>.

Page: (graphics)SHOWGRAPH, Next: PLOT, Prev: LABEL, Up: Top

### SUBROUTINE SHOWGRAPH()

flushes the internal buffer, which could otherwise delay the graph from being shown on screen.

Page: (graphics)PLOT, Next: nographics, Prev: SHOWGRAPH, Up: Top

### SUBROUTINE PLOT(REAL FUNCTION(REAL) f; REAL x1,x2)

### SUBROUTINE PLOT(REAL FUNCTION(INTEGER) f; INTEGER x1,x2)

### SUBROUTINE PLOT(REAL FUNCTION(INTEGER) f; ARRAY(∗) OF REAL vecx)

### SUBROUTINE PLOT(ARRAY(∗) OF REAL vec)

### SUBROUTINE PLOT(ARRAY(∗) OF REAL vecy,vecx)

These subroutines have the purpose of plotting an entire 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.

Page: (graphics)nographics, Next: gnuplot, Prev: Top, Up: Top

## nographics.cpl

Fake plotting package that allows graphics to be turned off by USEing this library instead of graphics without modifying the rest of the program.

Page: (graphics)gnuplot, Next: strlines, Prev: nographics, Up: Top

## gnuplot.cpl

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:

Page: (graphics)SPLOT, Next: strlines, Prev: gnuplot, Up: gnuplot

### SUBROUTINE SPLOT(REAL FUNCTION(REAL x,y) f; REAL xmin..xmax,ymin..ymax)

### SUBROUTINE SPLOT(REAL FUNCTION(REAL x,y) f)

### SUBROUTINE SPLOT(REAL FUNCTION(INTEGER x,y) vec; INTEGER xmin..xmax,ymin..ymax)

### SUBROUTINE SPLOT(ARRAY(∗,∗) OF REAL vec)

### SUBROUTINE SPLOT(ARRAY(∗,∗) OF INTEGER vec)

### SUBROUTINE SPLOT(ARRAY(∗,∗) OF REAL vec; ARRAY(∗) OF REAL x,y)

Page: (graphics)strlines, Next: (parallel), Prev: gnuplot, Up: Top

## strlines.cpl

This separate library contains specialized routines to draw random streamline segments out of an array of velocity values.