PGRAF(1)

NAME

pghp - (Hewlett Packard 2623a and 2648a terminals)

pgtek - (Tektronix 4010 and friends)

pgx - (X11 output)

pgfig - (Fig output)

pgps - (Postscript output for a printer)

pgeps - (Encapsulated postscript output for embedding in documents)

SYNOPSIS
pghp; pgtek; pgx [font [linewidth]]; pgfig > outfile.fig pgps > outfile.ps pgeps > outfile.eps

DESCRIPTION

Pgraf programs are metacode interpreters for the portable graphics system. They read the file pgraf3.out which has been created by a user program calling pgraf subroutines (see pgraf(3)). The programs read one screenful at a time (i. e., up to a gpause).

Pgraf programs share a common main routine written in the C language called pg.c. All dependence on particular graphics devices is contained in a set of low level subroutines called by pg.c, which are now described:

    pgmove(x,y) -- Move pen to a new position (x,y) without drawing a line.
    pgdraw(x,y,ltype) -- Draw a line from the current pen position to (x,y).
    pgtext(x,y,text) -- Write text starting at (x,y), centered vertically.
    pginfo(&cx,&cy) -- Returns x and y character dimensions for particular device in cx and cy.
    pginit() -- Initializes graphics device and clears screen.
    pgflsh() -- Clears buffer and closes device. Asks user to type return when new screenful is desired. Also can handle the production of screen image hard copy.

All drawing is done in an abstract space called screen space, with 0 <= x < 15 and 0 <= y < 10. The character dimensions cx and cy are given in screen space. The variables x, y, cx, and cy are all of type float. The variable text is a character string. Lines are drawn in four different styles, determined by setting the integer variable ltype to 1, 2, 3, or 4. As a matter of convention, 1 = solid, 2 = dashed, 3 = dotted, and 4 = dot dashed. However, different devices may use different ways of distinguishing line types, such as color. Implementing pgraf on a new device requires only that new low level subroutines be written for that device (in C) and linked with pg.c.

The X11 viewer, pgx, has some special characteristics. Pressing the left mouse button backs up one plot, while pressing the right button causes the viewer to exit. Pressing the middle button advances one plot or causes an exit if the current plot is the last. Pressing the left or middle mouse button while holding down various keys causes perspective view plots to change in certain ways. In particular, ``a'' changes the viewing azimuth, ``e'' changes the elevation, ``z'' changes the zoom factor, and ``r'' changes the distance from plot.

SEE ALSO

pgraf(3) (description of C and fortran metacode generating routines);

pgraf(5) (description of the metacode).

BUGS

Pgraf doesn't react kindly to syntax errors in the metacode. When in doubt, examine the metacode directly (in file pgraf3.out).

Only one metacode file per directory can exist at any one time unless renaming is done.