PGCURSenables the cursor on the selected device, positions it at a specified location within the viewport, and allows the user to move it. When the user has positioned the cursor, he types a key on his terminal;
PGCURSreturns the cursor position (in world coordinates) and the character that was typed. On some devices the user can also click (depress and release) a mouse button. Buttons 1, 2, 3 have the same effect as typing A, D, or X. Routine
PGBANDis similar to
PGCURSbut has additional options that request that a visible line (``rubber band'') or rectangle join the cursor position to a fixed point and track it as it moves. These options are not available on every device that supports a cursor.
In addition, PGPLOT provides three higher-level routines for cursor
PGLCUR. These three routines require that the device has
PGOLIN allows the
user to specify a set of points within the viewport, with the
capability of correcting mistakes. Interactive commands (single
on the keyboard) allow the user to add a point at the current
cursor position, delete the last-entered point, or exit
from the subroutine. The world-coordinates of the entered points are
returned to the calling program. The following program fragment
illustrates the use of
PGOLIN; the user supplies
NPT (up to 50) points with world-coordinates
Y(), and the program then shades the
polygon defined by these points by calling
INTEGER NPT REAL X(50), Y(50) ... WRITE (6,*) 'Use the cursor to draw a polygon' WRITE (6,*) 'Type A to add point, D to delete, X to exit' NPT = 0 CALL PGOLIN (50, NPT, X, Y, 0) IF (NPT.GE.3) CALL PGPOLY (NPT, X, Y)
PGNCURis similar to
PGOLIN, but the points are sorted into increasing order of x before being returned to the calling program. In addition, the delete command deletes the point nearest to the cursor, rather than the last-entered point. It can be used, for example, to allow the user to supply a set of points to represent the continuum level on a spectrum.
PGLCURis similar to
PGOLINbut instead of using a graph marker to mark each entered point it draws a polyline through them.
PGUPDT) are provided for controlling the buffering of output. All three routines have no arguments.
causes PGPLOT to begin saving graphical output in a buffer. The output
is saved until (1) a matching
PGEBUF call is made, or (2)
the buffer fills up, or (3) the buffer is emptied by a call to
PGUPDT, or (4)
PGEND is called. The routine
buffering and causes the buffered commands to be sent to the output
device. Calls to
always be paired.
PGBBUF increments an internal counter,
PGEBUF decrements this counter and flushes the
buffer to the output device when the counter drops to zero. This
allows a subroutine to turn on and turn off buffering without
disturbing any buffering that may have been established by the calling
empties the buffer created by
PGBBUF, but it does not
alter the internal counter. The routine should be called when it is
essential that the display be completely up-to-date (before
interaction with the user, for example) but it is not known if output
is being buffered.
Usually output is not buffered; this is the default state established
PGBEG. The default behavior can be changed, however,
by defining an environment variable
PGPLOT_BUFFER. If this variable is defined, with any
PGBEG will start buffering output (by calling
The following example shows how routine
PGLAB might be implemented
in terms of routine
SUBROUTINE PGLAB (XLBL, YLBL, TOPLBL) CHARACTER*(*) XLBL, YLBL, TOPLBL CALL PGBBUF CALL PGMTXT('T', 2.0, 0.5, 0.5, TOPLBL) CALL PGMTXT('B', 3.2, 0.5, 0.5, XLBL) CALL PGMTXT('L', 2.2, 0.5, 0.5, YLBL) CALL PGEBUF ENDThe calls to
PGEBUFensure that the output generated by the three calls to
PGMTXTis buffered (i.e., sent to the output device as a single command instead of three separate ones). If buffering is already enabled by the program which calls
PGLAB, the calls to
PGEBUFhave no effect.
On some devices (e.g., X-Window workstations) use of buffering can greatly speed up the execution of a program.