.NNM
.LO 3,3
.AP
.RM 65
.NO FLAGS
.FIRST TITLE
.TITLE GRAFIT Library Routines
.LT
    		     TABLE OF CONTENTS


Introduction ..............................................  4

Section 1. Basic Graphics Concepts ........................  6

Section 2. Subroutine CALL Outline ........................  9

Section 3. Job Delimiting Subroutines .....................  12

     SETUP    subroutine ..................................  12
     TKTITL   subroutine ..................................  12
     START    subroutine ..................................  13
     BUFOUT   subroutine ..................................  13
     EPLOT    subroutine ..................................  13
     END      subroutine ..................................  13
     BYEBYE   subroutine ..................................  14
     HPTITL   subroutine ..................................  15
     HDCOPY   subroutine ..................................  15
     HSTART   subroutine ..................................  17
     HERROR   subroutine ..................................  18
     HPTEXT   subroutine ..................................  18
     HEPLOT   subroutine ..................................  18
     HEND     subroutine ..................................  18

Section 4. Dialogue Area Subroutines ......................  19

     DMAPIN   subroutine ..................................  19
     GIGI     subroutine ..................................  19
     CLEAR    subroutine ..................................  19
     CURSOR   subroutine ..................................  20
     DIALOG   subroutine ..................................  20
     MARGIN   subroutine ..................................  20
     OUTPF    subroutine ..................................  21
     OUTPG    subroutine ..................................  21
     OUTPI    subroutine ..................................  21
     OUTPS    subroutine ..................................  22
     NALPHA   function ....................................  22
     NCHTRU   function ....................................  22
     TABSPC   subroutine ..................................  22
     COMMAS   subroutine ..................................  23
     COMMAD   subroutine ..................................  23
     SPAWNS   subroutine ..................................  25
     PAUSE    subroutine ..................................  25
.el
.pg
.lt
Section 5. Graphics Area Subroutines ......................  26

     CMAPIN   subroutine ..................................  26
     FRESHS   subroutine ..................................  26
     FACTOR   subroutine ..................................  26
     ROTATE   subroutine ..................................  26
     PEN      subroutine ..................................  27
     PLOT     subroutine ..................................  27
     SHADE    subroutine ..................................  27
     SHOFF    subroutine ..................................  27
     ORIGIN   subroutine ..................................  28
     WHERE    subroutine ..................................  28
     HPFORC   subroutine ..................................  28
     HPOINT   subroutine ..................................  28

Section 6. Graphics Segment Subroutines ...................  29

     SPIVOT   subroutine ..................................  29
     SGOPEN   subroutine ..................................  29
     SGMOVE   subroutine ..................................  30
     SGTRAN   subroutine ..................................  30
     SGRENM   subroutine ..................................  30
     SGVISS   subroutine ..................................  30
     SGBLINK  subroutine ..................................  31

Section 7. Graphics Input (GIN) Subroutines ...............  32

     GINYES   subroutine ..................................  32
     GINREP   subroutine ..................................  32
     PICKAP   subroutine ..................................  32

Section 8. Macro Subroutines ..............................  33

     MACDEF   subroutine ..................................  33
     MACEXP   subroutine ..................................  33
     KEYEXP   subroutine ..................................  33

Section 9. Annotation Subroutines .........................  34

     GRTEXT   subroutine ..................................  34
     SYMBOL   subroutine ..................................  34
     SYMTXT   subroutine ..................................  34
     LABEL    subroutine ..................................  35
     NUMBER   subroutine ..................................  36
     SYMGRK   subroutine ..................................  36
     SYMDES   subroutine ..................................  36
     HSYMPLS  subroutine ..................................  37
     CSLANT   subroutine ..................................  37
.el
.pg
.lt
Section 10. Axis Drawing Subroutines ......................  38

     LGXAX    subroutine ..................................  38
     LGYAX    subroutine ..................................  39
     LNXAX    subroutine ..................................  40
     LNYAX    subroutine ..................................  41
     XAXIS    subroutine ..................................  42
     YAXIS    subroutine ..................................  43
     AXIS     subroutine ..................................  44
     LISCAL   subroutine ..................................  44

Section 11. Line Drawing Subroutines ......................  45

     FLINE    subroutine ..................................  45
     DLINE    subroutine ..................................  46

Section 12. Figure Drawing Subroutines ....................  47

     ARROW    subroutine ..................................  47
     ARROWH   subroutine ..................................  47
     BARS     subroutine ..................................  47
     BOXS     subroutine ..................................  48
     CHORD    subroutine ..................................  48
     CIRCLE   subroutine ..................................  49
     ELLIPS   subroutine ..................................  49
     OBLICK   subroutine ..................................  50
     POLYGN   subroutine ..................................  50
     TKLOGO   subroutine ..................................  50
     HPLOGO   subroutine ..................................  50
.EL
.PG
Introduction:
     This document describes fully all the library routines written
for GRAFIT, which support the following interactive video devices:
.lt

     	1) Tektronix-4100 command series graphics terminals
     	2) ReGIS command series graphics terminals
     	3) ANSI/VT100 compatible text terminals

and the following hardcopy devices:

     	1) Hewlett Packard HP7550 (HPGL) series pen plotter
     	2) Hewlett Packard HP7221 series pen plotter
     	3) Hewlett Packard HP7475 series pen plotter

.el
The library contains a number of plotting subroutines which adhere 
to the old Calcomp formats for names and arguments.  However rigid 
adherence to Calcomp formats is impossible because of the added 
functionality of modern graphics devices.  For this reason a number of
new subroutines have been written and new functions for the old arguments 
and a number of new arguments have been added to conventional Calcomp
calls. The following is a list of subroutines in the library which still
retain conventional Calcomp formats for names and arguments:
.lt

     START ---- initialize plotter to start a plot session.
     FACTOR --- set plot overall scale factors (x,y).
     CSLANT --- set character slant angle of graphtext string.
     PEN ------ set colors for drawing graphtext and line.
     PLOT ----- perform drawing and moving of graphics pen.
     SYMBOL --- draw graphtext string and marker symbols.
     NUMBER --- draw scale decimals with digit control.
     AXIS ----- draw x,y axes of linear types.
     WHERE ---- report last pen location and scale factors.
     EPLOT ---- reset plotter to terminate a plot session.
     END ------ reset plotter to terminate a plot session.
.el
     All subroutines are written in FORTRAN-77 and the formats of 
arguments obey FORTRAN implicit convention. All dimensional and 
coordinate arguments are in the units of inches and angular arguments 
in the units of degrees except for otherwise indicated. Character
arguments can be passed either in variable of TEXT*(*) or TEXT(*)*1 
or in character literal like 'JUNK.DAT'.
    Since the library supports both interactive and hardcopy devices 
it needs to have a number of library subroutines which perform exactly 
the same functions on the interactive terminals and on the 
hardcopy devices.  The naming convention for these library subroutines 
is to have a leading H for each of those supporting the hardcopy 
devices. These similar basic library subroutines are listed below:
.LT

     START ---- initialize plotter to start a plot session.
     CSLANT --- set character slant angle of graphtext string.
     PEN ------ set colors for drawing graphtext and line.
     PLOT ----- perform drawing and moving of graphics pen.
     GRTEXT --- draw graphtext string.
     SYMDES --- draw marker symbols.
     EPLOT ---- reset plotter to terminate a plot session.
.el
In this document, hardcopy supporting subroutines are indicated by a
trailing <*>. All subroutines supporting the interactive graphics devices 
have been compiled and stored in TKLIB.OLB and those supporting hardcopy 
devices in HPLIB.OLB. To link to the library, issue the following
DCL commands:
.lt

     $ FORT your_program
     $ LINK your_program, GRAF$IT:TKLIB/LIB,HPLIB/LIB,TKLIB/LIB

.EL
Maximum functionality is implemented on a Tek-4100 command series 
graphics terminal with a Hewlett Packard HP7550 series pen plotter
as the hardcopy device and hence the graphics concepts presented
in this document are discussed based on the maximum functionality.
When running with a combination of other interactive and hardcopy
devices supported, only a subset of the functionality can be performed.
.b 5
Acknowledgement:
     This library together with the 2-D interactive graphics layout 
program GRAFIT, for which the library was designed, could not possiblly 
be accomplished without the professional and sustained helps and supports 
from Dr. Robert L. Snyder and Mr. James Walker.
.b 5
.lt
     					Zhou, Rongsheng 
     					NYS College of Ceramics
     					Alfred University
     					Alfred, NY 14802
     					August 15, 1987
.el
.pg
.b
Section 1. Basic Graphics Concepts
.b
(1) Dialogue area and graphics area:
     On a Tek-4100 command series terminal, there are two areas --- 
dialogue area and graphics area overlayed. Dialogue area is on top 
of graphics area. All interactive dialogue activities are conducted 
in dialogue area whereas all graphics activities are carried out in 
graphics area. The size of dialogue area can be set by the 
DIALOG subroutine in number of dialogue area lines from 2 to 30 
lines. If you specify dialogue area less than 30 lines, graphics 
area is uncovered to be visible. If you specify dialogue area less 
than 2 lines, dialogue area is invisible. You can also specify one 
to two sections of dialogue area to be fixed as non-scroll dialogue 
areas by calling the MARGIN subroutine.
.b
(2) Color definition and color index:
     Each of the 8 color indices (0 to 7 used in the library) has a color 
definition associated with it. The actual color visualized for a color 
index depends on its color definition. Dialogue area and graphics 
area have their own set of color indices, which are totally independent 
of each other. In this library, a color index is defined by three 
coordinates in TEK's HLS color cone system:
.LT

     First coordinate  = hue       	( 0 to 360 degree )
     second coordinate = lightness 	( 0 to 100 percent)
     Third coordinate  = saturation	( 0 to 100 percent)

.EL
When the SETUP subroutine is executed, the color indices for
dialogue area and graphics area are defined as follows:
.lt

     Dialogue area:

    	index 0 = black  ( HLS =   0,   0,   0 )
    	index 1 = white  ( HLS =   0, 100,   0 )
    	index 2 = black  ( HLS =   0,   0,   0 )
    	index 3 = blue   ( HLS =   0,  50, 100 )
    	index 4 = green  ( HLS = 240,  50, 100 )
    	index 5 = yellow ( HLS = 180,  50, 100 )
    	index 6 = purple ( HLS =  60,  50, 100 )
    	index 7 = red    ( HLS = 120,  50, 100 )

     Graphics area:

    	index 0 = green  ( HLS = 200,  40,  40 )
    	index 1 = black  ( HLS =   0,   0,   0 )
    	index 2 = blue   ( HLS =   0,  50, 100 )
    	index 3 = red    ( HLS = 120,  50, 100 )
    	index 4 = green  ( HLS = 240,  50, 100 )
    	index 5 = purple ( HLS =  60,  50, 100 )
    	index 6 = yellow ( HLS = 180,  50, 100 )
    	index 7 = white  ( HLS =   0, 100,   0 )
.el
     The reason for dialogue area to have different color definitions
from those in graphics area is to match the default color indices 
used by ANSI color renditions to those in graphics area. 
The CMAPIN subroutine allows you to define the color indices in
graphics area; the DMAPIN in dialogue area. 
     A Tek-4100 command series terminal uses color index 0 to set the 
background color in graphics area. If you change the color definition 
of color index 0 in graphics area, the background color of graphics area
changes correspondingly.
     To set the background color in dialogue area, you either use
the DIALOG subroutine to designate a defined color index or to fix 
it to be one of the seven color indices in DIALOG subroutine and 
then change the color definition of that color index (note: you can 
not define color index 0 for the background color in dialogue area. 
Color index 0 always means transparent). The difference between the two 
methods is in the number of different colors resulted. By designating 
a color index, you can get maximum 8 different colors whereas you can 
get a kind of continuous color spectrum by changing the color 
definition of a specific color index. The same applies to the color 
setting in graphics area.
.B
(3) Graphics segments:
     A graphics segment is a graphics object drawn and defined by the
user, stored in terminal's local memory (which is called the general 
purpose memory differing from the raster memory) and identified by
a user specified integer called the segment number. Once a graphics 
segment has been defined, you can manipulate it by calling the 
subroutines described in Section 6 --- Graphics Segment Subroutines.
     Some of graphics segment numbers have been reserved in this library:
.lt

     Segment 0     = intrinsic crosshair cursor.
     Segment 1,2,3 = used by the START subroutine.
     Segment 9     = used by the GINYES subroutine.
     Segment 99999 = used by the SGOPEN subroutine.

.el
A TEK-4105 type of terminal does not have enough local memory 
to support segment graphics except for segment 0 (the crosshair cursor).
It thus ignores all operations related to graphics segments and stores 
all graphics activities in its raster memory. When the FRESHS 
subroutine is executed, it clears the raster memory of the terminal only 
but redisplays all the graphics segments defined.
.b
(4) Graphics Input (GIN):
     Graphics Input (GIN) is a terminal local function which allows
for location of physical points on terminal screen space by manipulating
an intrinsic crosshair cursor with the keyboard joydisk. Two operation
modes of GIN are implemented in this library:
.lt

     (a) GIN locator --- allow for report of cursor location only.
     (b) GIN pick ------ allow for report of cursor location and
     			 graphics segment touched by cursor as well.

.el
GIN locator is supported by all models of Tek-4100 command series
graphics terminals but GIN pick is only supported by those with enough
local memory (like Tek-4107,Tek-4205,Tek-4207,etc.) for user to define 
graphics segments. Section 7 of the document describes some basic 
subroutines to perform GIN.
.B
(5) Macros:
     A macro is a string of ASCII characters identified by a user
specified integer called the macro number and stored in terminal local 
memory. After a macro is defined, you can recall the character string 
associated with a macro by simply calling the macro number (termed macro 
expansion). Two kinds of macros should be distinguished:
     (a) key macro: a macro whose macro number identifies an ASCII 
code of a keyboard key and can be expanded by simply pressing that 
key. The contents (character string) of a key macro when expanded
will be sent to the host computer in terminal's output stream as if 
you have finished a bunch of key strokes. The advantage of using a 
key macro is to simplify keyboard input in conducting an interactive 
dialogue.
     (b) non-key macro: a macro whose macro number does not identify
an ASCII code of any keyboard key and can be expanded only from the
host computer. The contents (character string) of a non-key macro
when expanded will be displayed on local terminal screen as if they 
have been sent from the host computer. The advantage of using a 
non-key macro is to speed up communication between the host computer
and user terminal.
     Section 8 of the document describes some basic subroutines which 
support volatile macro definition and expansion. 
.PG
.LT
Section 2. Subroutine CALL Outline

     A list of all subroutine and function calls is given below
in alphabetical order:

====================================================================
TKLIB.OLB:
====================================================================
SUBROUTINE ARROW   (XPOS,YPOS,ANGLE,WIDTH,HEIGHT)
SUBROUTINE ARROWH  (XPOS,YPOS,WIDTH,HEIGHT,THICK,RATIO,ANGLE,IHP)
SUBROUTINE AXIS    (XPOS,YPOS,LABEL,NCHS,XLENG,ANGLE,FSTV,DELTA)
SUBROUTINE BARS    (XPOS,YPOS,BARW,BARH,ANGLE,IHP,NLINE)
SUBROUTINE BOXS    (XPOS,YPOS,BOXW,BOXH,THICK,ANGLE,IHP)
SUBROUTINE BUFOUT
SUBROUTINE BYEBYE
SUBROUTINE CHORD   (ANGLE)
SUBROUTINE CIRCLE  (XPOS,YPOS,RADIUS,THICK,ANGL1,ANGL2,IHP)
SUBROUTINE CLEAR   (IC)
SUBROUTINE CMAPIN  (NS,INDEX,ICI)
SUBROUTINE COMMAD  (TEXT,NCHS,NFLD,GFLD,KFLD,NLAS)
SUBROUTINE COMMAS  (TEXT,NCHS,NFLD,GFLD,KFLD,NLAS)
SUBROUTINE CSLANT  (IANGLE)
SUBROUTINE CURSOR  (IL,IC)
SUBROUTINE DIALOG  (IDL,ID1,ID2,ID3)
SUBROUTINE DLINE   (X1,Y1,X2,Y2,LTYP,FACT)
SUBROUTINE DMAPIN  (INDEX,ICI)
SUBROUTINE ELLIPS  (XPOS,YPOS,RAD1,RAD2,THICK,ANGL0,ANGL1,ANGL2,IHP)
SUBROUTINE END     (DUMY)
SUBROUTINE EPLOT
SUBROUTINE FACTOR  (XFACTOR,YFACTOR)
SUBROUTINE FLINE   (XARRAY,YARRAY,NPOINT,LTYP,ISYM,SIZE,FCT,ISH)
SUBROUTINE FRESHS
SUBROUTINE GIGI    (IC)
SUBROUTINE GINREP  (GLPR,XP,YP,NS,ID)
SUBROUTINE GINYES  (MODE,ICODE,IPEN)
SUBROUTINE GRTEXT  (XPOS,YPOS,TEXT,NCHAR,WIDTH,HEIGHT,ANGLE)
SUBROUTINE KEYEXP  (ICODE)
SUBROUTINE LABEL   (XST,XED,YST,YED,TXT,NCH,WTH,HGT)
SUBROUTINE LGXAX   (XLN,YLN,IBD,NCS,FST,DEL,DST,IGD,IRR)
SUBROUTINE LGYAX   (XLN,YLN,IBD,NCS,FST,DEL,DST,IGD,IRR)
SUBROUTINE LISCAL  (ARRAY,NTICKS)
SUBROUTINE LNXAX   (XLN,YLN,IBD,NCS,FST,DEL,DST,MTK,IGD,IRR)
SUBROUTINE LNYAX   (XLN,YLN,IBD,NCS,FST,DEL,DST,MTK,IGD,IRR)
SUBROUTINE MACDEF  (NUMBER,LENGTH,STRING)
SUBROUTINE MACEXP  (NUMBER)
SUBROUTINE MARGIN  (ITOP,IBOTTOM)
SUBROUTINE NUMBER  (XPOS,YPOS,HEIGHT,DECIMAL,ANGLE,NDIGITS)
SUBROUTINE OBLICK  (XPOS,YPOS,RAD1,RAD2,THICK,ANGLE,IHP)
SUBROUTINE ORIGIN  (IOX,IOY,ICODE)
SUBROUTINE OUTPF   (DARRAY,IR,FL,IL,IC)
SUBROUTINE OUTPG   (DARRAY,IR,FL,IL,IC)
SUBROUTINE OUTPI   (IARRAY,IR,IF,IL,IC)
SUBROUTINE OUTPS   (TEXT,NCHS,IL,IC)
SUBROUTINE PAUSE   (NSECS)
SUBROUTINE PEN     (IPEN)
SUBROUTINE PICKAP  (APERTURE)
SUBROUTINE PLOT    (XPOS,YPOS,IPEN)
SUBROUTINE POLYGN  (XPOS,YPOS,RADIUS,THICK,ANGLE,NSIDE,IHP)
SUBROUTINE ROTATE  (XANGLE,YANGLE,SANGLE)
SUBROUTINE SETUP   (ITERM)
SUBROUTINE SGBLINK (NSG)
SUBROUTINE SGMOVE  (NSG,XPOS,YPOS)
SUBROUTINE SGOPEN  (ICODE)
SUBROUTINE SGRENM  (NOLD,NNEW)
SUBROUTINE SGTRAN  (NSEG,XPOS,YPOS,ANGLE,XFCT,YFCT)
SUBROUTINE SGVISS  (NSG,ICODE)
SUBROUTINE SHADE   (IHP)
SUBROUTINE SHOFF   (IHP)
SUBROUTINE SPAWNS  (ICODE,TEXT)
SUBROUTINE SPIVOT  (XPOS,YPOS)
SUBROUTINE START   (XORG,YORG)
SUBROUTINE SYMBOL  (XPOS,YPOS,HEIGHT,TEXT,ANGLE,NCHAR)
SUBROUTINE SYMDES  (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)
SUBROUTINE SYMGRK  (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)
SUBROUTINE SYMTXT  (XPOS,YPOS,TEXT,NCHAR,WIDTH,HEIGHT,ANGLE)
SUBROUTINE TABSPC  (NSPACES)
SUBROUTINE TKLOGO  (XPOS,YPOS,SIZE)
SUBROUTINE TKTITL  (TEXT)
SUBROUTINE WHERE   (XLOC,YLOC,XFAC,YFAC)
SUBROUTINE XAXIS   (XLN,YLN,IBD,NCS,FST,DEL,DST,NTK,MTK,NDG,IGD,IRR)
SUBROUTINE YAXIS   (XLN,YLN,IBD,NCS,FST,DEL,DST,NTK,MTK,NDG,IGD,IRR)
FUNCTION   NALPHA  (TEXT,MAX)
FUNCTION   NCHTRU  (TEXT,MAX,WIDTH)
====================================================================
.EL
.PG
.LT
HPLIB.OLB:
====================================================================
SUBROUTINE HARROW  (XPOS,YPOS,ANGLE,WIDTH,HEIGHT)
SUBROUTINE HARROWH (XPOS,YPOS,WIDTH,HEIGHT,THICK,RATIO,ANGLE,IHP)
SUBROUTINE HAXIS   (XPOS,YPOS,LABEL,NCHS,XLENG,ANGLE,FSTV,DELTA)
SUBROUTINE HBARS   (XPOS,YPOS,BARW,BARH,ANGLE,IHP,NLINE)
SUBROUTINE HBOXS   (XPOS,YPOS,BOXW,BOXH,THICK,ANGLE,IHP)
SUBROUTINE HCHORD  (ANGLE)
SUBROUTINE HCIRCLE (XPOS,YPOS,RADIUS,THICK,ANGL1,ANGL2,IHP)
SUBROUTINE HCSLANT (IANGLE)
SUBROUTINE HDLINE  (X1,Y1,X2,Y2,LTYP,FACT)
SUBROUTINE HELLIPS (XPOS,YPOS,RAD1,RAD2,THICK,ANGL0,ANGL1,ANGL2,IHP)
SUBROUTINE HEND    (DUMY)
SUBROUTINE HEPLOT
SUBROUTINE HFACTOR (XFACTOR,YFACTOR)
SUBROUTINE HFLINE  (XARRAY,YARRAY,NPOINT,LTYP,ISYM,SIZE,FCT,ISH)
SUBROUTINE HGRTEXT (XPOS,YPOS,TEXT,NCHAR,WIDTH,HEIGHT,ANGLE)
SUBROUTINE HDCOPY  (IFLAG,IARRAY,RARRAY,FNAME)
SUBROUTINE HERROR  (IERROR)
SUBROUTINE HPFORC  (IPEN,IFORCE)
SUBROUTINE HPLOGO  (XPOS,YPOS,SIZE)
SUBROUTINE HPOINT  (XPOS,YPOS)
SUBROUTINE HPTEXT  (TEXT)
SUBROUTINE HPTITL  (TEXT)
SUBROUTINE HLABEL  (XST,XED,YST,YED,TXT,NCH,WTH,HGT)
SUBROUTINE HLGXAX  (XLN,YLN,IBD,NCS,FST,DEL,DST,IGD,IRR)
SUBROUTINE HLGYAX  (XLN,YLN,IBD,NCS,FST,DEL,DST,IGD,IRR)
SUBROUTINE HLNXAX  (XLN,YLN,IBD,NCS,FST,DEL,DST,MTK,IGD,IRR)
SUBROUTINE HLNYAX  (XLN,YLN,IBD,NCS,FST,DEL,DST,MTK,IGD,IRR)
SUBROUTINE HNUMBER (XPOS,YPOS,HEIGHT,DECIMAL,ANGLE,NDIGITS)
SUBROUTINE HOBLICK (XPOS,YPOS,RAD1,RAD2,THICK,ANGLE,IHP)
SUBROUTINE HORIGIN (IOX,IOY,ICODE)
SUBROUTINE HPEN    (IPEN)
SUBROUTINE HPLOT   (XPOS,YPOS,IPEN)
SUBROUTINE HPOLYGN (XPOS,YPOS,RADIUS,THICK,ANGLE,NSIDE,IHP)
SUBROUTINE HROTATE (XANGLE,YANGLE,SANGLE)
SUBROUTINE HSHADE  (IHP)
SUBROUTINE HSHOFF  (IHP)
SUBROUTINE HSTART  (XORG,YORG)
SUBROUTINE HSYMBOL (XPOS,YPOS,HEIGHT,TEXT,ANGLE,NCHAR)
SUBROUTINE HSYMDES (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)
SUBROUTINE HSYMGRK (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)
SUBROUTINE HSYMTXT (XPOS,YPOS,TEXT,NCHAR,WIDTH,HEIGHT,ANGLE)
SUBROUTINE HSYMPLS (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)
SUBROUTINE HWHERE  (XLOC,YLOC,XFAC,YFAC)
SUBROUTINE HXAXIS  (XLN,YLN,IBD,NCS,FST,DEL,DST,NTK,MTK,NDG,IGD,IRR)
SUBROUTINE HYAXIS  (XLN,YLN,IBD,NCS,FST,DEL,DST,NTK,MTK,NDG,IGD,IRR)
====================================================================
.EL
.PG
.LT
Section 3. Job Delimiting Subroutines

====================================================================
subroutine SETUP (ITERM)
====================================================================

     This routine does the following:

    	<*> open logical unit 50 for terminal graphics:
    	    open(unit=50, name='TT:', status='NEW',
    	    carriagecontrol='NONE', recl=NBYTES)
    	    (NBYTES = 132 bytes currently)
    	<*> set color mode = 3, 1, 1
    	<*> set viewport window = 4095 x 3132
    	<*> set graphtext precision = stroke
    	<*> set graphics area writing mode = overstrike
    	<*> set graphics area color map for surface #1
    	<*> set EOM character = carriage-return
    	<*> set report EOM frequency = 1
    	<*> set GIN pick aperture = 0.1 inches
    	<*> set dialogue area color map
    	<*> set alpha cursor indices = 4, 7
    	<*> set dialogue area color = 1, 3, 3
    	<*> set dialogue area line = 30
    	<*> clear dialogue area
    	<*> set origin mode in dialogue area = absolute
    	<*> enable dialogue area
    	<*> enable key-expansion of key macros
    	<*> clear terminal graphics memory

     ITERM specifies (if 0<ITERM<4 as input argument) but
     identifies (as a returned argument if ITERM=0 as input
     argument) the type of terminal on line:

     	1 = Tektronix-4100 command series graphics terminal
     	2 = ReGIS command series graphics terminal
     	3 = ANSI/VT100 compatible text terminal

     This routine should be called FIRST and only ONCE 
     by any program using this graphics library.
     START subroutine will initialize terminal setup once
     if SETUP has not been executed at the first place.

====================================================================
subroutine TKTITL (TEXT)
====================================================================

     This routine allows for input of user's program title
     to be displayed in the background of graphics area:
           TEXT --- program title in character format.
.el
.pg
.lt
====================================================================
subroutine START (XORG,YORG)
====================================================================

     This routine initializes some graph parameters 
     necessary to start a new plot session on terminals:

     	XORG --- graph origin (x).
     	YORG --- graph origin (y).

     The origin is specified relative to the lower left
     corner of the screen.
     When called, START erases the screen and displays
     a framework with graph title(specified by TKTITL),
     graph origin marker and the color definition of all
     color indices defined by CMAPIN.

====================================================================
subroutine BUFOUT
====================================================================

     This routine dumps out the graphics buffer. The graphics 
     buffer is the one opened by the SETUP subroutine with the 
     logical unit 50 and the buffer size of 132 bytes. It is 
     used to store a batch of graphics instructions and their 
     parameters sent to the terminal by the subroutines in the
     library. Some of the subroutines in the library execute
     BUFOUT subroutine before returning so that the functions 
     performed by the subroutines can be seen on the screen
     immediately. However some of them don't. Therefore you 
     must call this subroutine to dump out the graphics buffer 
     to finish a plot session.

====================================================================
subroutine EPLOT
====================================================================

     This routine exists for Calcomp call compatibility.
     It is equivalent to BUFOUT.

====================================================================
subroutine END (DUMY)
====================================================================

     This routine exists for Calcomp call compatibility.
     It is equivalent to BUFOUT.
.el
.pg
.lt
====================================================================
subroutine BYEBYE
====================================================================

     This routine resets terminals and it should be called
     just before terminating the program (the LAST to call).

Example of calling procedure to plot on screen:
--------------------------------------------------------------------
     	PROGRAM MAIN
     	ITERM = 0
     	CALL SETUP( ITERM )
     	IF( ITERM.EQ.0 ) GOTO 999	!BAIL OUT
     	CALL TKTITL( 'GRAFIT' )
     	......
     	CALL CRTPLOT
     	......
     	CALL BYEBYE
999	CALL EXIT
     	END

     	SUBROUTINE CRTPLOT
     	......
     	CALL DIALOG( 3, 1, 3, 3 )
     	CALL START( 2.0, 1.5 )
     	......
     	CALL BUFOUT / CALL EPLOT / CALL END( DUMY )
     	RETURN
     	END
--------------------------------------------------------------------
.EL
.PG
.LT
====================================================================
subroutine HPTITL (TEXT) 					<*>
====================================================================

     This routine allows for input of user's program title
     to be displayed on hardcopy:

     TEXT --- program title in character format

====================================================================
subroutine HDCOPY (IFLAG,IARRAY,RARRAY,FNAME) 			<*>
====================================================================

     This routine implements an interactive dialogue menu
     which allows for specification of hardcopy attributes
     and it should be called before each hardcopy session.
     However, you can skip calling HDCOPY and in this case
     HSTART will use a default set of hardcopy attributes.

     IARRAY --- integer array of length 20:

     IARRAY( 1): hardcopy ID (username+filename, 0=off, 1=on)
     IARRAY( 2): hardcopy ID (date, 0=off, 1=on)
     IARRAY( 3): hardcopy ID (AU logo, 0=off, 1=on)
     IARRAY( 4): hardcopy ID (program title, 0=off, 1=on)
     IARRAY( 5): hardcopy color (0=off, 1=on)
     IARRAY( 6): paper feed upon finish (0=off, 1=on)
     		 (effective only on HP plotters with paper feed)
     IARRAY( 7): rotation (90 degrees) for vertical plot (0=off,1=on)
     		 (effective only on HP7550 plotters)
     IARRAY( 8): paper tray loaded (0=small, 1=large)
     		 (referred to only for location of hardcopy IDs)
     IARRAY( 9): square root (1 to 9) of plotter pen speed in cm/s
     IARRAY(10): plot output mode or plotter interfacing mode:

     	0 = The plot is written to a file ready to be copied
     	    to the desired plotter.  No plotter interfacing
     	    mode needs to be specified.  At the dollar prompt
     	    use COPY command to copy the file to the plotter.
     	    The name of the plot file is given from FNAME.
     	1 = Terminal <=> Computer <=> Plotter.
     	    The plot is first written to a plot file and then
     	    submitted to the plot queue waiting to be copied to
     	    the plotter, which is a stand-alone system plotter.
     	    Refer to IARRAY(11) for plotter designation code.
     	2 = Terminal <=> Computer <=> Plotter.
     	    The plot is dumped directly to the plotter, which is
     	    a stand-alone system plotter.  No queue is observed.
     	    Refer to IARRAY(11) for plotter designation code.
.EL
.PG
.LT
     	3 = Terminal <=> Plotter <=> Computer.
     	    The plot is dumped directly to the plotter, which is
     	    wired up between the host computer and your terminal.
     	    In other words, your terminal must be plugged into the
     	    plotter's terminal port and the host computer into the
     	    plotter's modem port. The plotter must be in BYPASS-ON
     	    mode and the plotter baud is the same as the terminals
     	    to allow for this interfacing mode to work.
     	4 = Plotter <=> Terminal <=> Computer.
     	    The plot is dumped directly to the plotter,
     	    which is plugged into your terminals printer port.
     	    The printer port must be enabled and support ANSI
     	    printer controller mode and the X-ON/X-OFF protocol.

     	Handshake mode implemented: X-ON/X-OFF.

     IARRAY(11): plotter designation code (0 to 99)

     	The attribute applies only for the 1st or the 2nd plotter
     	interfacing modes (IARRAY(10)=1 or 2). When more than one
     	plotter is on-line and all accessible to the user, use the 
     	code to select the desired plotter for making the hardcopy.
     	The designated logical address used for dumping the hardcopy
     	will then be HP# where # is the value of IARRAY(11). 
     	When IARRAY(11)=0, the logical address HP is assumed, 
     	which should be the default plotter address of your computer.

     IARRAY(12): type of plotter on line (0 to 2).

     		 0 => HP7550-HPGL series
     		 1 => HP7221      series
     		 2 => HP7475      series

     IARRAY(13): number of hardcopies to be made (1 to 99).

     	The number specifies how many hardcopies are to be made
     	in a single queued plotjob and applies only for the 1st
     	plotter interfacing mode (IARRAY(10)=1).

     IARRAY(14) to IARRAY(20): pen force codes (1 to 8).

     	The 7 numbers apply to the 7 pens on the plotter.
     	The first number is for pen #1 in the holder, etc.
     	The valid force codes are from 1 to 8 corresponding
     	to the following forces in grams to be applied:
     	     CODE:   1    2    3    4    5    6    7    8
     	    GRAMS:  15   24   30   36   45   51   57   66
     	and only effective on a HP7550 type of plotter.
.EL
.PG
.LT
     RARRAY --- REAL*4 array of length 6.

     RARRAY(1): plot offset (x) relative to XORG in HSTART.
     RARRAY(2): plot offset (y) relative to YORG in HSTART.

     RARRAY(3): plot overall scale factor (x) on hardcopy.
     RARRAY(4): plot overall scale factor (y) on hardcopy.

     	Zoom in (1.0<) or zoom out (>1.0) the plot on hardcopy.
     	If you select different scale factors in x,y directions,
     	you achieve different aspect ratios of plot on hardcopy.
     	The scale factors have no effect on the plot offsets.
     	Valid range is from 0.25 to 3.0.

     RARRAY(5): retracing offset (x) (boldface print)
     RARRYA(6): retracing offset (y) (boldface print)

     	Retracing offsets apply to all boldface prints that appear
     	on the hardcopy. Examples of boldface prints include line
     	retrace, character retrace, and area fill. You may want to
     	set different offset values for different tip thickness of
     	plotter pens loaded (e.g. 0.3 or 0.7 mm) or to achieve a
     	different degree of solid fill in retracing. The values of 
     	offsets are specified in inches (defaults = 0.01, 0.01).
     	Valid range is from 0.001 to 0.1.

     FNAME --- name of file to be plotted in character format
     	       and max 32 characters. It could be blank.

     IARRAY,RARRAY must be initialized before calling HDCOPY.

     Input IFLAG options:
     	IFLAG=0: conduct the interactive dialogue.
     	IFLAG=1: skip the interactive dialogue.
     Returned IFLAG option:
     	IFLAG=-1: bail out from the interactive dialogue.

====================================================================
subroutine HSTART (XORG,YORG) 					<*>
====================================================================

     This routine initializes HP plotters and certain
     graph parameters necessary to make a hardcopy:

     	XORG,YORG --- graph origin (x,y) on hardcopy.

     The origin is specified relative to the lower left
     corner of plotter paper.
.EL
.PG
.LT
====================================================================
subroutine HERROR (IERROR) 					<*>
====================================================================

     This routine returns with
     	IERROR=0 for OK opening of plotter line in HSTART.
     	IERROR=1 for open failure of plotter line in HSTART.
     and should be called following HSTART.

====================================================================
subroutine HPTEXT (TEXT)					<*>
====================================================================

     This routine writes a message onto the display window
     of a Hewlett Packard HP7550 series plotter.

     TEXT --- message to be displayed in character format
     	      (max 32 characters allowed, uppercase only).

====================================================================
subroutine HEPLOT						<*>
====================================================================

     This routine terminates a hardcopy.

====================================================================
subroutine HEND (DUMY)						<*>
====================================================================

     This routine exists for Calcomp call compatibility.
     It is equivalent to HEPLOT.

Example of calling procedure to make a hardcopy:
--------------------------------------------------------------------
     	SUBROUTINE HARDCOPY
     	DIMENSION IARRAY(20), RARRAY(6)
     	DATA IARRAY / 1,0,0,0,1,1,0,0,0,1,0,0,1, 2,2,2,2,2,2,2 /
     	DATA RARRAY / 0.00, 0.00, 1.00, 1.00, 0.01, 0.01 /
     	......
     	IFLAG = 0
     	CALL HDCOPY( IFLAG, IARRAY, RARRAY, 'JUNK.DAT' )
     	IF( IFLAG.EQ.-1 ) RETURN
     	CALL HSTART( 2.0, 1.5 )
     	CALL HERROR( IERROR )
     	IF( IERROR.EQ.1 ) RETURN
     	......
     	CALL HEPLOT / CALL HEND(DUMY)
     	RETURN
     	END
--------------------------------------------------------------------
.el
.pg
.lt
Section 4. Dialogue Area Subroutines

====================================================================
subroutine DMAPIN (INDEX,IC1,IC2,IC3)
====================================================================

     This routine defines the color index for dialogue area
     in TEK's HLS color cone system:

    	INDEX: color index 		( 0 - 7   )
    	IC1  : hue 			( 0 - 360 )
    	IC2  : lightness 		( 0 - 100 )
    	IC3  : saturation 		( 0 - 100 )

====================================================================
subroutine GIGI (IC)
====================================================================

     This routine implements ANSI graphics renditions 
     in dialogue area:  IC=#*

    	# = char-cell color index ( 1-7, 0=unchanged )
    	* = character color index ( 1-7, 0=unchanged )
    	#=8 intense display on (e.g. IC=80 just intense   )
    	*=9 blink on           (e.g. IC=9 just blink      )
    	#=9 underscore on      (e.g. IC=90 just underscore)
    	IC<0, reverse video is on, otherwise off.

     Note: Tek-4100 command series graphics terminals
     	   do not support ANSI intense print command.

====================================================================
subroutine CLEAR (IC)
====================================================================

     This routine erases dialogue area by ANSI commands
     (the cursor is dialogue area cursor --- alpha-cursor):

     IC=0: erase the entire dialogue area and cursor home at (1,1)
     IC=1: erase the entire dialogue area and cursor does not move
     IC=2: erase from the current cursor to the end of dialogue area
     IC=3: erase from the current cursor to the top of dialogue area
     IC=4: erase from the current cursor to the end of line
     IC=5: erase from the current cursor to the start of line
     IC=6: erase the entire line of current cursor.
.el
.pg
.lt
====================================================================
subroutine CURSOR (IL,IC)
====================================================================

     This routine positions the alpha cursor
     at dialogue area line   --- IL ( 1-30, top=>bottom )
     at dialogue area column --- IC ( 1-80, left=>right )
     by ANSI cursor manipulating commands.

     If IL=0, IC specifies incremental move of cursor
     relative to the current column position:
     	-IC moves cursor  forward by IC columns
     	+IC moves cursor backward by IC columns

     If IC=0, IL specifies incremental move of cursor
     relative to the current line position:
     	-IL moves cursor   up by IL lines
     	+IL moves cursor down by IL lines

====================================================================
subroutine DIALOG (IDL,ID1,ID2,ID3)
====================================================================

     This routine sets dialogue area lines and color indices
     for Tek-4100 command series terminals:

    	ID1 : character color index	(  0 - 7  )
    	ID2 : cell color index		(  0 - 7  )
    	ID3 : background color index	(  0 - 7  )
    	IDL : dialogue area lines 	( -1 - 30 )

     If -1<IDL<2, dialogue area is invisible, otherwise visible.
     If IDL> 1, dialogue area is set and erased.
     If IDL<-1, dialogue area is set and but not erased.
     If IDL=-1, skip setting dialogue area.
     On ReGIS and text terminals, DIALOG erases the screen.

====================================================================
subroutine MARGIN (ITOP,IBOTTOM)
====================================================================

     This routine sets the top and the bottom margins of 
     dialogue area in number of dialogue area lines by ANSI 
     command. The top and the bottom margins are non-scroll
     dialogue area:

     ITOP --- the 1st line from top of screen for scroll area.
     IBOTTOM --- the last line from top of screen for scroll area.
.el
.pg
.lt
     When ITOP=0, IBOTTOM=0, the whole screen is set to
     scroll without margins, and the origin mode of
     dialogue area is set to absolute. The valid numbers
     for ITOP and IBOTTOM are

     	0 < ITOP    < 31 (25 on non-Tektronix terminals)
     	0 < IBOTTOM < 31 (25 on non-Tektronix terminals)

     and     ITOP < IBOTTOM - 1

====================================================================
subroutine OUTPF (DARRAY,IR,FL,IL,IC)
====================================================================

     This routine places a number of decimal numbers 
     in dialogue area by ANSI command:

    	DARRAY --- array that stores the decimals.
    	IR ------- array size ( number of decimals ).
    	IL ------- dialogue area line number  ( 1-30, top=>bottom ).
    	IC ------- dialogue area column number( 1-80, left=>right ).
    	FL ------- field length in decimal format #.# --> F#.#
     		   Example: FL=6.2 gives F6.2

====================================================================
subroutine OUTPG (DARRAY,IR,FL,IL,IC)
====================================================================

     This routine places a number of decimal numbers 
     in dialogue area by ANSI command:

    	DARRAY --- array that stores the decimals.
    	IR ------- array size ( number of decimals ).
    	IL ------- dialogue area line number  ( 1-30, top=>bottom ).
    	IC ------- dialogue area column number( 1-80, left=>right ).
    	FL ------- field length in decimal format #.# --> G#.#
     		   Example: FL=11.4 gives G11.4

====================================================================
subroutine OUTPI (IARRAY,IR,IF,IL,IC)
====================================================================

     This routine places a number of integers 
     in dialogue area by ANSI command:

    	IARRAY --- integer array that stores the integers.
    	IR ------- array size  ( number of integers ).
    	IF ------- field length  ( 0=I,1=I1,2=I2,3=I3;4=I4,5=I5 ).
    	IL ------- dialogue area line number  ( 1-30, top=>bottom ).
    	IC ------- dialogue area column number( 1-80, left=>right ).
.EL
.PG
.LT
====================================================================
subroutine OUTPS (TEXT,NCHS,IL,IC)
====================================================================

     This routine places a text string in character format
     in dialogue area by ANSI command:

    	TEXT --- text string to be displayed.
    	NCHS --- number of characters in text string.
    	IL ----- dialogue area line number( 1-30, top=>bottom ).
     		 IL<0 : display in double width line.
    	IC ----- dialogue area column number( 1-80, left=>right ).
     		 IC<0 : display in double height line.

====================================================================
function NALPHA (TEXT,MAX)
====================================================================

     This routine returns with the length of character string
     TEXT in number of characters in NALPHA where MAX is the 
     maximum length of TEXT. If MAX<0, TEXT is converted to 
     uppercase. Embedded characters of ASCII codes less than 32
     are stripped except TAB key which is replaced by a number
     of blank spaces (use TABSPC subroutine to set the desired
     number of spaces for TAB key substitution, default=5).

====================================================================
function NCHTRU (TEXT,MAX,WIDTH)
====================================================================

     This routine returns the true length of character string
     TEXT which may contain the flag characters like \,^,@ etc
     for the auxiliary lettering functions described in the
     SYMTXT/HSYMTXT subroutine for graphtext plotting.

     	MAX ----- maximum number of characters in TEXT.
     	WIDTH --- width of characters to be plotted.

====================================================================
subroutine TABSPC (NSPACES)
====================================================================

     This routine sets the number of blank spaces for 
     embedded TAB key substitution performed in NALPHA.

     	NSPACES --- number of spaces (default=5).
.EL
.PG
.LT
====================================================================
subroutine COMMAS (TEXT,NCHS,NFLD,GFLD,KFLD,NLAS)
====================================================================

     This routine implements a free format input processor.

     TEXT --- textstring in character format to be decoded.
     NCHS --- number of characters in TEXT.
     NFLD --- number of REAL*4 decimals to be decoded from TEXT.
     GFLD --- REAL*4 array to store the decoded decimals.
     KFLD --- integer array to flag which element of GFLD array
     	      gets an input: 0=no, 1=yes.
     NLAS --- the position of the last character in TEXT that
     	      doesn't get decoded.

     COMMENTS:

     The field separator can be either a space or spaces or comma.
     To skip a field, commas must be used and the input processor
     returns with its KFLD(I)=0.

     Integer fields are decoded and stored in GFLD array as
     decimal numbers. Therefore decimals can be entered as 
     integers and vice versa.

     An error results if the input processor encounters trailing
     text characters in TEXT before NFLDth data field gets decoded
     from TEXT and it returns with NCHS=0. Therefore the value of
     NCHS must be passed by a variable instead of constant and the
     calling routine should always check returned NCHS for possible
     error input. If there is no trailing text characters, TEXT
     can have fewer than NFLD number of data fields and the rest 
     of GFLD components are filled with values 0.0 and KFLD with 0.

====================================================================
subroutine COMMAD (TEXT,NCHS,NFLD,GFLD,KFLD,NLAS)
====================================================================

     A double precision version (REAL*8) of COMMAS.
.EL
.PG
.LT
An example of using COMMAS is given below:
--------------------------------------------------------------------
     	SUBROUTINE FINPUT
     	PARAMETER IUNIT= 1, LWD= 100
     	CHARACTER TEXT*(LWD)
     	DIMENSION RP(10), KP(10)
     	......
C
C  READ IN A TEXT STRING OF 100 BYTES AT A TIME...
C
111	READ(IUNIT,222,END=999,ERR=999) TEXT
222	FORMAT(A)
     	IF( TEXT.EQ.' ' ) GOTO 111	!SKIP BLANK LINE
C
C  GET THE TRUE LENGTH OF "TEXT" WHICH WILL BE STRIPPED OFF
C  EMBEDDED CHARACTERS OF ASCII CODES LESS THAN 32 WITH THE
C  TABS REPLACED BY A NUMBER OF SPACES...
C
     	NCHS = NALPHA( TEXT, LWD )
     	IF( NCHS.LT.11 ) GOTO 333
C
C  GET 8 DATA FIELDS FROM "TEXT" STARTING FROM THE 11TH BYTE...
C
     	NCHS = NCHS - 10
     	CALL COMMAS( TEXT(11:), NCHS, 8, RP, KP, IDUMY )
     	IF( NCHS.EQ.0 ) GOTO 333	!ERROR DECODING
C
C  STORE THE NON-SKIPPED DATA FIELDS...
C
     	IF( KP(1).EQ.1 ) IC1 = RP(1)	!FIRST FIELD: INTEGER
     	IF( KP(2).EQ.1 ) FC1 = RP(2)	!SECOND FILED: DECIMAL
     	......
     	IF( KP(8).EQ.1 ) IC4 = RP(8)	!LAST FIELD: INTEGER
     	GOTO 111
C
C  ERROR INPUT IN "TEXT"...
C
333	CALL ERROR( TEXT )
     	GOTO 111
999	CLOSE(UNIT=IUNIT)
     	RETURN
     	END
--------------------------------------------------------------------
.EL
.PG
.LT
====================================================================
subroutine SPAWNS (ICODE,TEXT)
====================================================================

     This routine spawns a system subprocess specified
     by a DCL command line contained in TEXT.

     TEXT: character string in the format of "SPAWN command".
     If "command" is blank, SPAWNS will prompt with "SPAWN>".

     ICODE: returned flag:
     	    0 = bail out from spawning.
     	    1 = go for spawning.

Example of calling SPAWNS:
--------------------------------------------------------------------
     	CALL SPAWNS( ICODE, 'SPAWN EDIT JUNK.DAT' )
     	CALL SPAWNS( ICODE, 'SPAWN RUN [POWDER.FILECONV]FILECONV' )
     	CALL SPAWNS( ICODE, 'SPAWN TYPE JUNK.DAT' )

     	TEXT = 'SPAWN COPY JUNK.DAT JUNK1.DAT'
     	CALL SPAWNS( ICODE, TEXT )

     	CALL SPAWNS( ICODE, 'SPAWN' )
     	SPAWN> TYPE JUNK.DAT
--------------------------------------------------------------------


====================================================================
subroutine PAUSE (NSECS)
====================================================================

     This routine sets pause in the execution of a program.

     	NSECS --- pause duration in seconds.
.el
.pg
.lt
Section 5. Graphics Area Subroutines

====================================================================
subroutine CMAPIN (NS,INDEX,IC1,IC2,IC3)
====================================================================

     This routine defines the color index in graphics area
     in TEK's HLS color cone system:

    	NS    : surface number  (always 1)
    	INDEX : color index 	( 0-15, 0=background index )
    	IC1   : hue 		( 0 - 360 )
    	IC2   : lightness 	( 0 - 100 )
    	IC3   : saturation 	( 0 - 100 )

====================================================================
subroutine FRESHS
====================================================================

     This routine issues <ESC><FF> to clear the raster memory 
     on a Tek-4100 command series graphics terminal.
     As a result, all existing graphics segments are replotted.

====================================================================
subroutine  FACTOR (X-SCALE-FACTOR,Y-SCALE-FACTOR)
subroutine HFACTOR (X-SCALE-FACTOR,Y-SCALE-FACTOR)		<*>
====================================================================

     This routine sets the overall scale factors of the graph
     for the subsequent plot coordinates and graphtext size.
     It can be called only after the START/HSTART subroutine.

====================================================================
subroutine  ROTATE (X-ANGLE,Y-ANGLE,S-ANGLE)
subroutine HROTATE (X-ANGLE,Y-ANGLE,S-ANGLE)			<*>
====================================================================

     This routine sets the reference rotations of x,y axes,
     and the rotation of character string independently 
     for subsequent plotting.

    	X-ANGLE --- rotation angle of x-axis from horizontal.
    	Y-ANGLE --- rotation angle of y-axis from vertical.
    	S-ANGLE --- rotation of the text string, which is 
    		    additive to the rotation specified in 
    		    the GRTEXT/HGRTEXT subroutine.
     	Negative angles ---> clockwise.
     	Positive angles ---> counter clockwise.
.EL
.PG
.LT
====================================================================
subroutine  PEN (IPEN)
subroutine HPEN (IPEN)						<*>
====================================================================

     This routine sets text-color-index, line-color-index
     in graphics area for subsequent plotting:
    
    	IPEN ---- color index defined in subroutine SETUP.
    	IPEN ---- pen number for pen plotter.

====================================================================
subroutine  PLOT (XPOS,YPOS,ICODE)
subroutine HPLOT (XPOS,YPOS,ICODE)				<*>
====================================================================

     This routine displaces graphics pen with origin control:

    	XPOS,YPOS --- ending coordinates of the pen.
    	ICODE = 3 : move with pen up
    	ICODE = 2 : move with pen down --- draw
    	ICODE =-3 : move with pen up, reorigin to (XPOS,YPOS)
    	ICODE =-2 : move with pen down, reorigin to (XPOS,YPOS)
    	ICODE =-9 : reorigin to (XPOS,YPOS) but don't move.

     The color of the pen is set by the PEN/HPEN subroutine.

====================================================================
subroutine  SHADE (IHP)
subroutine HSHADE (IHP)						<*>
====================================================================

     This routine enables (IHP>0) or disables (IHP=0) area shading
     in graphics area.  When enabled, area shading is performed for 
     the subsequent draw operations traced out by the PLOT/HPLOT 
     subroutine in a loop manner from the first pen location to 
     the last pen location and the hatching pattern of area shading 
     is designated by IHP. The valid number for IHP is from 1 to 17 
     corresponding to 17 different hatching patterns.

====================================================================
subroutine  SHOFF (IHP)
subroutine HSHOFF (IHP)						<*>
====================================================================

     This routine enables(IHP>0) or disables (IHP=0) area shading
     in graphics area. The PLOT/HPLOT subroutine then checks the 
     first pen-down action to start the shading. When SHOFF/HSHOFF
     is in effect, SHADE/HSHADE is disabled.
.EL
.PG
.LT
====================================================================
subroutine  ORIGIN (IOX,IOY,ICODE)
subroutine HORIGIN (IOX,IOY,ICODE)				<*>
====================================================================

     This routine reports the current graph origin in
     screen/plotter space units in (IOX,IOY) if ICODE=0
     and restores it with (IOX,IOY) if ICODE=1.
     The use of this routine is desirable to reduce the
     roundoff errors in keeping track of the current graph 
     origin if the PLOT/HPLOT subroutine is employed 
     to reorigin the plot.

====================================================================
subroutine  WHERE (XLOC,YLOC,XFAC,YFAC)
subroutine HWHERE (XLOC,YLOC,XFAC,YFAC)				<*>
====================================================================

     This routine reports the last pen location in (XLOC,YLOC) 
     recorded by the PLOT/HPLOT subroutine and the current 
     overall scale factors of graph in (XFAC,YFAC).

====================================================================
subroutine HPFORC (IPEN,IFORCE)					<*>
====================================================================

     This routine sets the pen force for Hewlett Packard
     HP7550 series pen plotter.

     	IPEN ----- number of pen to be set (1 to 7).
     	IFORCE --- force code from 1 to 8.

     	IFORCE:   1    2    3    4    5    6    7    8
     -----------------------------------------------------
     	 GRAMS:  15   24   30   36   45   51   57   66

====================================================================
subroutine HPOINT (XPOS,YPOS)					<*>
====================================================================

     This routine reads a digitized point from a Hewlett
     Packard pen plotter. The pen is positioned over the
     point to read and [ENTER] key on plotter depressed.

     XPOS --- x-coordinate relative to the current origin.
     YPOS --- y-coordinate relative to the current origin.
.EL
.PG
.LT
Section 6. Graphics Segment Subroutines

====================================================================
subroutine SPIVOT (XPOS,YPOS)
====================================================================

     This routine sets the pivot of a graphics segment 
     to be defined at (XPOS,YPOS),  which refers to the 
     current graph origin. The pivot of a graphics segment 
     is referred to and kept within screen space in graphics 
     segment transformation. To displace an existing graphics 
     segment in screen space, you only need to move its pivot.
     The SGMOVE and the SGTRAN subroutines to be described 
     below implements the operation of pivot displacement.
     If you do not specify the pivot point when creating
     a new graphics segment, it is defaulted to (0,0) in
     screen space units, which is at the very lower left 
     corner of screen.

====================================================================
subroutine SGOPEN (ICODE)
====================================================================

     This routine does the following:

    	ICODE = 0  : close the currently open graphics segment.
    	ICODE > 0  : open a new graphics segment of number ICODE.
    	ICODE < 0  : delete an existing segment of number ICODE.
    	ICODE=99999: delete all existing graphics segments.

     The valid segment numbers are from 1 to 32767 except for
     1, 2, 3, 9, 99999 which are reserved in this library.


An example of a graphics segment creation is given below:
--------------------------------------------------------------------
     CALL SPIVOT(1.0,1.0)		!set the pivot
     CALL SGOPEN(100)			!open segment #100
     CALL PEN(1)			!designate pen #1
     CALL CIRCLE(1.,1.,.5,0,0,0,1)	!draw a solid circle
     CALL PEN(3)			!designate pen #3
     CALL SYMDES(1.,1.,0.1,0.1,0,1)	!draw a marker symbol
     CALL SGOPEN(0)			!close the segment
--------------------------------------------------------------------
.EL
.PG
.LT
====================================================================
subroutine SGMOVE (NSG,XPOS,YPOS)
====================================================================

     This routine displaces the pivot of an existing
     graphics segment:

    	NSG --------- number of the segment to be moved.
    	XPOS,YPOS --- new pivot to move to, which is relative 
    		      to the current graph origin.

     You can displace the crosshair cursor whose pivot
     is at the intercept by specifying NSG=0.

====================================================================
subroutine SGTRAN (NSG,XPOS,YPOS,ANGLE,XSF,YSF)
====================================================================

     This routine transforms an existing graphics segment:

    	NSG --------- number of the segment to be transformed.
    	XPOS,YPOS --- new pivot to transform to, which is
    		      relative to the current graph origin.
    	ANGLE ------- rotation angle (not cumulative).
    	XSF,YSF ----- x,y scale-factors (not cumulative).

     Segment number 0 is invalid because the crosshair 
     cursor can not be transformed.

====================================================================
subroutine SGRENM (NOLD,NNEW)
====================================================================

     This routine renumbers an existing graphics segment
     from NOLD to NNEW.

====================================================================
subroutine SGVISS (NSG,ICODE)
====================================================================

     This routine turns on (ICODE=1) or turns off (ICODE=0)
     the visibility of an existing graphics segment of number
     NSG.  You can make the crosshair cursor invisible or
     visible by specifying NSG=0.
.EL
.PG
.LT
====================================================================
subroutine SGBLINK (NSG)
====================================================================

     This routine turns on (NSG>0) or turns off (NSG<0)
     the highlighting (blink) of an existing graphics 
     segment of number NSG. Segment number 0 is invalid 
     because segment 0 is the crosshair cursor for the 
     GIN functions and it can not be blinked.
.el
.pg
.lt
Section 7. Graphics Input (GIN) Subroutines

====================================================================
subroutine GINYES (MODE,ICODE,IPEN)
====================================================================

     This routine enables or disables GIN function:

    	MODE = 0 : enable or disable GIN locator
    	MODE = 1 : enable or disable GIN pick
    	ICODE= 0 : disable GIN function
    	ICODE= 1 : enable GIN with the crosshair cursor
    	ICODE= 2 : enable GIN with a small cross cursor
    	ICODE= 3 : enable GIN with a small arrowhead cursor
    	IPEN     : color index (1-7) for the cursor.
    		   IPEN<0 = blink cursor for ICODE=2,3.

     For ICODE=2,3, segment #9 is defined for the cursor.

====================================================================
subroutine GINREP (REPORT,XPOS,YPOS,NS,ID)
====================================================================

     This routine decodes GIN locator or pick report:

    	REPORT ----- input GIN report in byte format
    		     (key-character must be included).
    	XPOS,YPOS -- output graphics cursor position
     		     relative to the current graph origin.
    	NS --------- segment number picked for GIN pick.
    	ID --------- pick ID number for GIN pick.

====================================================================
subroutine PICKAP (APERTURE)
====================================================================

     This routine sets the APERTURE for GIN pick (default=0.1).
.el
.pg
.lt
Section 8. Macro Subroutines

====================================================================
subroutine MACDEF (NUMBER,LENGTH,STRING)
====================================================================

     This routine allows for definition of a volatile macro
     on a Tek-4100 terminal:

     NUMBER --- macro number for a non-key macro.
     		ASCII decimal equivalence for a key macro.
     		Valid range of NUMBER: -150 to 32767.
     		NUMBER=-1: delete all defined macros.
     		format: integer
     LENGTH --- number of characters in the macro.
     		LENGTH=0: delete the NUMBER macro.
     		format: integer
     STRING --- macro contents in ASCII decimal equivalences.
     		format: byte array

====================================================================
subroutine MACEXP (NUMBER)
====================================================================

     This routine expands a defined macro:

     	NUMBER --- number of macro to be expanded.

     Valid range of NUMBER: -150 to -2, 0 to 32767.

====================================================================
subroutine KEYEXP (ICODE)
====================================================================

     This routine enables (ICODE=1) or disables (ICODE=0)
     key expansion of the defined volatile key-macros.
.el
.pg
.lt
Section 9. Annotation Subroutines

====================================================================
subroutine  GRTEXT(XPOS,YPOS,TEXT,NCHAR,WIDTH,HEIGHT,ANGLE)
subroutine HGRTEXT(XPOS,YPOS,TEXT,NCHAR,WIDTH,HEIGHT,ANGLE)	<*>
====================================================================

     This routine displays graphtext in graphics area:

     XPOS,YPOS --- lower left corner of the 1st character.
     TEXT -------- text string in character format.
     NCHAR ------- number of characters in text string.
     WIDTH ------- character width of text string.
     HEIGHT ------ character height of text string.
     ANGLE ------- rotation angle of text string.

====================================================================
subroutine  SYMBOL (XPOS,YPOS,HEIGHT,TEXT,ANGLE,NCHAR)
subroutine HSYMBOL (XPOS,YPOS,HEIGHT,TEXT,ANGLE,NCHAR)		<*>
====================================================================

     This routine displays graphtext in graphics area
     and exists for Calcomp call compatibility:

     XPOS,YPOS --- lower left corner of the 1st character.
     HEIGHT ------ character height of text string (WIDTH=HEIGHT).
     TEXT -------- text string in character format.
     ANGLE ------- rotation angle of text string.
     NCHAR ------- number of characters in text string.

     If NCHAR<0, a marker symbol of code = ICHAR(TEXT(1))
     is plotted with
     	pen drawn to (XPOS,YPOS) if NCHAR = -2
     	pen moved to (XPOS,YPOS) if NCHAR = -1

====================================================================
subroutine  SYMTXT(XPOS,YPOS,TEXT,NCHAR,WIDTH,HEIGHT,ANGLE)
subroutine HSYMTXT(XPOS,YPOS,TEXT,NCHAR,WIDTH,HEIGHT,ANGLE)	<*>
====================================================================

     This routine displays graphtext with auxiliary lettering
     functions implemented in graphics area:

     XPOS,YPOS --- lower left corner of the 1st character.
     TEXT -------- text string in character format.
     NCHAR ------- number of characters in text string.
     WIDTH ------- character width of text string.
     HEIGHT ------ character height of text string.
     ANGLE ------- rotation angle of text string.
.EL
.PG
.LT
     The auxiliary lettering functions are described below:

     \L:#TEXTSTRING^L => Underline (#=pen code   : 1 TO 7)
     \B:#TEXTSTRING^B => Bold face (#=bold index : 1 TO 9)
     \S:#TEXTSTRING^S => Italics   (#=slant index:-3 TO 3)
     \#  TEXTSTRING^P => Coloring  (#=pen code   : 1 TO 7)

     where :# allows for some manipulation of function values
     and are optional if you buy the defaults, and if ^* is at
     the end of a text line, it can be omitted as well.
     The default function values are:

     Underline: line color is the same as the text color;
     		To change line color, select # from 1 to 7.
     Italics   : 10 degree to the right (#=1). To change slant angle,
     		select # from -3 to 3 corresponding to a slant angle
     		from 30-to-the-left to 30-to-the-right degrees.
     Boldface : number of retracing is 1 (#=1).
     		To change retracing times, select # from 1 to 9.

     {C => Convert the following character C into a superscript.
     }C => Convert the following character C into a subscript.
     @C => Convert the following character C into an extended character.
     @! => Backspace; {{ => Double superscript; }} => Double subscript.


====================================================================
subroutine  LABEL(XST,XED,YST,YED,TEXT,NCHAR,WIDTH,HEIGHT)
subroutine HLABEL(XST,XED,YST,YED,TEXT,NCHAR,WIDTH,HEIGHT)	<*>
====================================================================

     This routine centers a text string within two space points:

    	XST,XED --- start and end x-coordinates.
    	YST,YED --- start and end y-coordinates.
    	TEXT ------ text string in character format.
    	NCHAR ----- number of characters in text string.
    	WIDTH ----- character width of text string.
    	HEIGHT ---- character height of text string.
.EL
.PG
.LT
====================================================================
subroutine  NUMBER(XPOS,YPOS,HEIGHT,DECIMAL,ANGLE,NDIGITS)
subroutine HNUMBER(XPOS,YPOS,HEIGHT,DECIMAL,ANGLE,NDIGITS)	<*>
====================================================================

     This routine draws a number in decimal format:

    	XPOS,YPOS --- starting position to draw the number.
    	HEIGHT ------ character height of the number.
    	DECIMAL ----- input decimal number to be drawn.
    	ANGLE ------- string rotation angle.
    	NDIGITS ----- number of digits after decimal point.
    		      If NDIGITS<0, no decimal point is drawn.

====================================================================
subroutine  SYMGRK (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)
subroutine HSYMGRK (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)		<*>
====================================================================

     This routine draws a character from the extended
     character set which consists of most of mathematical
     symbols and greek letters.

     XPOS,YPOS --- lower left corner of the character.
     WIDTH ------- character width.
     HEIGHT ------ character height.
     ANGLE ------- character rotation angle.
     ICODE ------- character identification code or
     		   ASCII code of keyboard key which is
     		   mapped to the extended character.
     		   Valid range is from 33 to 126.

====================================================================
subroutine  SYMDES (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)
subroutine HSYMDES (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)		<*>
====================================================================

     This routine draws a marker symbol using alternate
     set of characters (marker symbol character set).

     XPOS,YPOS --- centre of the symbol.
     WIDTH ------- symbol width.
     HEIGHT ------ symbol height.
     ANGLE ------- symbol rotation angle.
     ICODE ------- symbol identification code.
.EL
.PG
.LT
     		ICODE = 1 : SQUARE
     		ICODE = 2 : OCTAGON
     		ICODE = 3 : TRIANGLE
     		ICODE = 4 : PLUS
     		ICODE = 5 : CROSS
     		ICODE = 6 : DIAMOND
     		ICODE = 7 : UPWARD-ARROWHEAD
     		ICODE = 8 : CROSS WITH TOP BAR
     		ICODE = 9 : CHARACTER Z
     		ICODE =10 : CHARACTER Y
     		ICODE =11 : CROSS + SQUARE
     		ICODE =12 : STAR
     		ICODE =13 : CROSS WITH TOP AND BOTTOM BARS
     		ICODE =14 : DOUBLE TRIANGLES
     		ICODE =15 : SOLID SQUARE
     		ICODE =16 : SOLID OCTAGON
     		ICODE =17 : SOLID TRIANGLE
     		ICODE =18 : SOLID DIAMOND
     		ICODE =19 : CIRCLE
     		ICODE =20 : DONUN
     		ICODE =21 : HALF MOON
     		ICODE =22 : SOLID CIRCLE
     		ICODE =23 : CIRCLE + CROSS

====================================================================
subroutine HSYMPLS (XPOS,YPOS,WIDTH,HEIGHT,ANGLE,ICODE)		<*>
====================================================================

     This routine draws a marker symbol using HPLOT commands
     only and should be called when using a pen plotter which
     does not support the alternate symbol character set
     (such as a HP7475 plotter).

     XPOS,YPOS --- centre of the symbol.
     WIDTH ------- symbol width.
     HEIGHT ------ symbol height.
     ANGLE ------- symbol rotation angle.
     ICODE ------- symbol identification code which has
     		   the same definitions as in HSYMDES.

====================================================================
subroutine  CSLANT (IANGLE)
subroutine HCSLANT (IANGLE)					<*>
====================================================================

     This routine sets the character slant of graphtext to
     IANGLE degrees  (-90<90, positive angle=clockwise).
.EL
.PG
.LT
Section 10. Axis Drawing Subroutines

====================================================================
subroutine  LGXAX (XLN,YLN,IBD,NCS,FST,DEL,DST,IGD,IRR)
subroutine HLGXAX (XLN,YLN,IBD,NCS,FST,DEL,DST,IGD,IRR)		<*>
====================================================================

     This routine draws a log10 x-axis at current graph origin:

     	XLN --- x-axis length.
     		XLN>0 => ticks on the opposite side of annotation.
     		XLN<0 => ticks on the same side of annotation.
     	YLN --- y-axis length.
     		YLN>0 => annotation below the axis.
     		YLN<0 => annotation above the axis.
     	IBD --- axis title in character format.
     	NCS --- number of characters in title.
     	FST --- scale value (round off to 10**n)
     		at the 1st major tick mark.
     	DEL --- log cycles (n) on the axis.
     	DST --- offset from origin to draw the 1st major tick mark.
     	IGD --- axis pattern code:
     		1: draw the axis with major and minor scale numbers
     		2: draw the axis with major scale numbers only
     		3: draw the axis with grid lines on major ticks.
     		4: draw the axis with grid lines on minor ticks as well.
     		5: draw the axis with no scale numbers
     	minus IGD: draw the axis with an arrowhead.
     	dual  IGD: draw the opposite axis of the same pattern.
     	IRR --- axis retracing times (bold axis): 0 to 5.
     		The scale numbers and axis lines are retraced.
.EL
.PG
.LT
====================================================================
subroutine  LGYAX (XLN,YLN,IBD,NCS,FST,DEL,DST,IGD,IRR)
subroutine HLGYAX (XLN,YLN,IBD,NCS,FST,DEL,DST,IGD,IRR)		<*>
====================================================================

     This routine draws a log10 y-axis at current graph origin:

     	XLN --- x-axis length.
     		XLN>0 => annotation to the left of axis.
     		XLN<0 => annotation to the right of axis.
     	YLN --- y-axis length.
     		YLN>0 => ticks on the opposite side of annotation.
     		YLN<0 => ticks on the same side of annotation.
     	IBD --- axis title in character format.
     	NCS --- number of characters in title.
     	FST --- scale value (round off to 10**n)
     		at the 1st major tick mark.
     	DEL --- log cycles (n) on the axis.
     	DST --- offset from origin to draw the 1st major tick mark.
     	IGD --- axis pattern code:
     		1: draw axis with major and minor scale numbers
     		2: draw axis with major scale numbers only
     		3: draw axis with grid lines on major ticks.
     		4: draw axis with grid lines on minor ticks as well.
     		5: draw axis with no scale numbers
     	minus IGD: draw axis with an arrowhead.
     	dual  IGD: draw the opposite axis of the same pattern.
     	IRR --- axis retracing times (bold axis): 0 to 5.
     		The scale numbers and axis lines are retraced.
.EL
.PG
.LT
====================================================================
subroutine  LNXAX(XLN,YLN,IBD,NCS,FST,DEL,DST,MTK,IGD,IRR)
subroutine HLNXAX(XLN,YLN,IBD,NCS,FST,DEL,DST,MTK,IGD,IRR)	<*>
====================================================================

     This routine draws a Ln x-axis at current graph origin.

     	XLN --- x-axis length.
     	YLN --- y-axis length.
     		YLN>0 => annotation below the axis.
     		YLN<0 => annotation above the axis.
     	IBD --- axis title in character format.
     	NCS --- number of characters in title.
     	FST --- scale value (round off to 10**n)
     		at the 1st major tick mark.
     	DEL --- log cycles (n) on the axis.
     	DST --- offset from origin to draw the 1st major tick mark.
     	MTK --- number of minor tick marks between the majors.
     		MTK>0 ticks on the same opposite of annotation.
     		MTK<0 ticks on the same side of annotation.
     	IGD --- axis pattern code:
     		1: draw axis with major and minor ticks.
     		2: draw axis with major tick only.
     		3: draw axis with grid lines on major ticks.
     		4: draw axis with grid lines on minor ticks as well.
     		5: draw axis with no scale numbers
     	minus IGD: draw axis with an arrowhead.
     	dual  IGD: draw the opposite axis of the same pattern.
     	IRR --- axis retracing times (bold axis): 0 to 5.
     		The scale numbers and axis lines are retraced.
.EL
.PG
.LT
====================================================================
subroutine  LNYAX(XLN,YLN,IBD,NCS,FST,DEL,DST,MTK,IGD,IRR)
subroutine HLNYAX(XLN,YLN,IBD,NCS,FST,DEL,DST,MTK,IGD,IRR)	<*>
====================================================================

     This routine draws a Ln y-axis at current graph origin.

     	XLN --- x-axis length.
     		XLN>0 => annotation to the left of axis.
     		XLN<0 => annotation to the right of axis.
     	YLN --- y-axis length.
     	IBD --- axis title in character format.
     	NCS --- number of characters in title.
     	FST --- scale value (round off to 10**n)
     		at the 1st major tick mark.
     	DEL --- log cycles (n) on the axis.
     	DST --- offset from origin to draw the 1st major tick mark.
     	MTK --- number of minor tick marks between the majors.
     		MTK>0 ticks on the same opposite of annotation.
     		MTK<0 ticks on the same side of annotation.
     	IGD --- axis pattern code:
     		1: draw axis with major and minor ticks.
     		2: draw axis with major tick only.
     		3: draw axis with grid lines on major ticks.
     		4: draw axis with grid lines on minor ticks as well.
     		5: draw axis with no scale numbers
     	minus IGD: draw axis with an arrowhead.
     	dual  IGD: draw the opposite axis of the same pattern.
     	IRR --- axis retracing times (bold axis): 0 to 5.
     		The scale numbers and axis lines are retraced.
.EL
.PG
.LT
====================================================================
subroutine  XAXIS(XLN,YLN,IBD,NCS,FST,DEL,DST,NTK,MTK,NDG,IGD,IRR)
subroutine HXAXIS(XLN,YLN,IBD,NCS,FST,DEL,DST,NTK,MTK,NDG,IGD,IRR) <*>
====================================================================

     This routine draws an x-axis at current graph origin.

     	XLN --- x-axis length.
     		XLN>0 => linear axis.
     		XLN<0 => inverse linear axis.
     	YLN --- y-axis length.
     		YLN>0 => annotation below the axis.
     		YLN<0 => annotation above the axis.
     	IBD --- axis title in character format.
     	NCS --- number of characters in title. 
     	FST --- scale value at the 1st major tick mark.
     	DEL --- scale increment between major tick marks.
     	DST --- offset from origin to draw the 1st major tick mark.
     	NTK --- number of major tick marks on the axis.
     	MTK --- number of minor tick marks between the majors.
     		MTK>0 ticks on the opposite side of annotation.
     		MTK<0 ticks on the same side of annotation.
     	NDG --- max number of digits for scale numbers.
     		0 = optimized within #####.###.
     		9 = skip drawing all scale numbers.
     		0<= skip drawing the multiplier (10**n).
     	IGD --- axis pattern code:
		1: draw axis with major and minor ticks.
     		2: draw axis with major tick only.
     		3: draw axis with grid lines on major ticks.
     		4: draw axis with grid lines on minor ticks as well.
     	minus IGD: draw axis with an arrowhead.
     	dual  IGD: draw the opposite axis of the same pattern.
     	IRR --- axis retracing times (bold axis): 0 to 5.
     		The scale numbers and axis lines are retraced.
.EL
.PG
.LT
====================================================================
subroutine  YAXIS(XLN,YLN,IBD,NCS,FST,DEL,DST,NTK,MTK,NDG,IGD,IRR)
subroutine HYAXIS(XLN,YLN,IBD,NCS,FST,DEL,DST,NTK,MTK,NDG,IGD,IRR) <*>
====================================================================

     This routine draws an y-axis at current graph origin.

     	XLN --- x-axis length.
     		XLN>0 => annotation to the left of axis.
     		XLN<0 => annotation to the right of axis.
     	YLN --- y-axis length.
     		YLN>0 => linear axis.
     		YLN<0 => inverse linear axis.
     	IBD --- axis title in character format.
     	NCS --- number of characters in title. 
     	FST --- scale value at the 1st major tick mark.
     	DEL --- scale increment between major tick marks.
     	DST --- offset from origin to draw the 1st major tick mark.
     	NTK --- number of major tick marks on the axis.
     	MTK --- number of minor tick marks between the majors.
     		MTK>0 ticks on the opposite side of annotation.
     		MTK<0 ticks on the same side of annotation.
     	NDG --- max number of digits for scale numbers.
     		0 = optimized within #####.###.
     		9 = skip drawing all scale numbers.
     		0<= skip drawing the multiplier (10**n).
     	IGD --- axis pattern code:
		1: draw axis with major and minor ticks.
     		2: draw axis with major tick only.
     		3: draw axis with grid lines on major ticks.
     		4: draw axis with grid lines on minor ticks as well.
     	minus IGD: draw axis with an arrowhead.
     	dual  IGD: draw the opposite axis of the same pattern.
     	IRR --- axis retracing times (bold axis): 0 to 5.
     		The scale numbers and axis lines are retraced.
.EL
.PG
.LT
====================================================================
subroutine  AXIS (XPOS,YPOS,LABEL,NCHS,XLENG,ANGLE,FSTV,DELTA)
subroutine HAXIS (XPOS,YPOS,LABEL,NCHS,XLENG,ANGLE,FSTV,DELTA)	<*>
====================================================================

     This routine exists for Calcomp call compatibility.

     	XPOS,YPOS --- starting point of the axis line.
     	LABEL --- axis label in character format.
     	NCHS ---- number of characters in the label.
     		  NCHS>0 annotates the axis clockwise for x-axis,
     		         count clockwise for y-axis.
     		  NCHS<0 annotates the axis clockwise for y-axis,
     		         count clockwise for x-axis.
     	XLENG --- axis length.
     	ANGLE --- rotation angle (x-axis=0.0 or y-axis=90.0 only).
     	FSTV ---- scale axis units at the first major tick mark.
     	DELTA --- scale increment of axis units per inch of axis.

====================================================================
subroutine LISCAL (VARRAY,NTICKS)
====================================================================

     This routine scales input VARRAY array for linear axis:

    	NTICKS ------- number of major tick marks on the axis
    	VARRAY(1) ---- input minimum
    	VARRAY(2) ---- input maximum
    	VARRAY(3) ---- output roundoff minimum.
    	VARRAY(4) ---- output roundoff increment 
    		       per major tick mark.
.el
.pg
.lt
Section 11. Line Drawing Subroutines

====================================================================
subroutine  FLINE(XARRAY,YARRAY,NPOINT,LTYP,ISYM,SIZE,FCT,ISH)
subroutine HFLINE(XARRAY,YARRAY,NPOINT,LTYP,ISYM,SIZE,FCT,ISH) <*>
====================================================================

     This routine draws a curve through an array of points:

    	XARRAY --- array of abscissas in user's own units.
    	YARRAY --- array of ordinates in user's own units.
    	NPOINT --- number of points in the array.
    		   NPOINT>0    connections between points.
    		   NPOINT<0 no connections between points.
    	LTYP = 1 : produce a solid line
    	LTYP = 2 : produce a short dash line
    	LTYP = 3 : produce a medium dash line
    	LTYP = 4 : produce a long dash line
    	LTYP = 5 : produce a long-short dash line
    	LTYP = 6 : produce a dot-dash line
    	LTYP = 7 : produce a one-dot center line
    	LTYP = 8 : produce a two-dot center line
    	LTYP = 9 : produce a three-dot center line
    	LTYP =10 : produce a dotted line
        LTYP < 0 : smooth the curve with a spline function.
    	ISYM ----- a marker symbol code.
     		   ISYM>0: put a marker symbol at each point.
     		   ISYM=0: no marker symbol at each point.
    		   See SYMDES subroutine for the code list.
    	SIZE ----- size of the marker symbols.
    	FCT ------ scale factor that controls the blank spacing
    		   for non-solid line plotting (default=1.0).
    	ISH ------ line plotting mode.
    		   ISH < 2: normal line plotting
    		   ISH = 2: stick plot (normal to x-axis)
    		   ISH > 2: bar plot (normal to x-axis,bar width=SIZE)
    		   See BARS subroutine for hatching pattern codes
     		   (hatching pattern code=ISH-3).

     Note: This routine expects the minima of data arrays
     stored in XARRAY(NPOINT+1), YARRAY(NPOINT+1) and the
     increments per inch in XARRAY(NPOINT+2), YARRAY(NPOINT+2).
.el
.pg
.lt
====================================================================
subroutine  DLINE (X1,Y1, X2,Y2, LTYP,FACT)
subroutine HDLINE (X1,Y1, X2,Y2, LTYP,FACT)			<*>
====================================================================

     This routine connects two points
     with a line of type indicated by LTYP:

     	X1,Y1 -- coordinates of the first point.
     	X2,Y2 -- coordinates of the second point.
    	FACT --- scale factor that controls the blank space
    		 for non-solid line plotting.
    	FACT<0.0: initialization for line style accumulation.

    	LTYP = 1: solid			LTYP = 2: short dash
    	LTYP = 3: medium dash		LTYP = 4: long dash
    	LTYP = 5: long and short dash	LTYP = 6: dot-dash
    	LTYP = 7: 1 dot center		LTYP = 8: 2 dot center
    	LTYP = 9: 3 dot center		LTYP =10: dotted

    	LTYP < 0: draw an arrowhead on (X2,X2).
    	Dual LTYP: draw an arrowhead on (X1,Y1) as well.
.el
.pg
.lt
Section 12. Figure Drawing Subroutines

====================================================================
subroutine  ARROW (XPOS,YPOS,ANGLE,WIDTH,HEIGHT)
subroutine HARROW (XPOS,YPOS,ANGLE,WIDTH,HEIGHT)		<*>
====================================================================

     This routine draws a line arrowhead:

    	XPOS,YPOS --- coordinates of the arrowhead tip.
    	WIDTH ------- width of the arrowhead.
    	HEIGHT ------ height of the arrowhead.
    	ANGLE ------- arrowhead orientation angle.
    		      ANGLE=0.0(>); ANGLE=90(^); ANGLE=180(<).
    		      Intermediate angles, of course, are allowed.

====================================================================
subroutine  ARROWH (XPOS,YPOS,WIDTH,HEIGHT,THICK,RATIO,ANGLE,IHP)
subroutine HARROWH (XPOS,YPOS,WIDTH,HEIGHT,THICK,RATIO,ANGLE,IHP) <*>
====================================================================

     This routine draws a big arrowhead:

    	XPOS,YPOS --- coordinates of the arrowhead tip.
    	WIDTH ------- width of the arrowhead.
    	HEIGHT ------ height of the arrowhead.
     	THICK ------- wall thickness (additive to WIDTH,HEIGHT).
     	RATIO ------- ratio of head to tail lengths.
     		      Valid range: 0.01 to 0.99 (default=0.5).
     	ANGLE ------- arrowhead orientation angle.
    		      ANGLE=0.0(<); ANGLE=90(V); ANGLE=180(>).
     		      Intermediate angles, of course, are allowed.
     	IHP --------- hatching pattern code for area fill.
     		      Valid range: -17 to 17 (0=no area fill).
     		      IHP>0: fill the inner; IHP<0: fill the wall.

====================================================================
subroutine  BARS (XPOS,YPOS,BARW,BARH,ANGLE,IHP,NLINE)
subroutine HBARS (XPOS,YPOS,BARW,BARH,ANGLE,IHP,NLINE)		<*>
====================================================================

     This routine draws a bar with a variety of hatching patterns.

     	XPOS,YPOS --- lower left corner of bar.
     	BARW -------- bar width in x dimension.
     	BARH -------- bar height in y dimension.
     	ANGLE ------- rotation angle from x-axis.
     	IHP --------- hatching pattern code of area fill.
.el
.pg
.lt
     		IHP = 0: blank bar
		IHP = 1: solid bar
		IHP = 2: bar with vertical lines
		IHP =-2: bar with shaded vertical lines
		IHP = 3: bar with horizontal lines
		IHP =-3: bar with shaded horizontal lines
		IHP = 4: grid lines( vertical + horizontal )
		IHP =-4: shaded grid lines.
		IHP = 5: hatch left to right ( 45 degree )
		IHP =-5: shaded hatch left to right ( 45 degree )
		IHP = 6: hatch right to left ( -45 degree )
		IHP =-6: shaded hatch right to left ( -45 degree )
		IHP = 7: hatch both ways( left + right )
		IHP =-7: shaded hatch both ways( left + right )
		IHP > 7: radial patterns

     	NLIN -------- number of hatching lines per inch.

====================================================================
subroutine  BOXS (XPOS,YPOS,BOXW,BOXH,THICK,ANGLE,IHP)
subroutine HBOXS (XPOS,YPOS,BOXW,BOXH,THICK,ANGLE,IHP)		<*>
====================================================================

     This routine draws a box with a variety of hatching patterns.

     	XPOS,YPOS --- lower left corner of box.
     	BOXW -------- box width in x dimension.
     	BOXH -------- box height in y dimension.
     	THICK ------- wall thickness (additive to BOXW,BOXH).
     	ANGLE ------- rotation angle from x-axis.
     	IHP --------- hatching pattern code for area fill.
     		      Valid range: 0 to 17 (0=no area fill).
     		      If IHP>0 and THICK=0, fill the inner.
     		      If IHP>0 and THICK>0<, fill the wall.

====================================================================
subroutine  CHORD (ANGLE)
subroutine HCHORD (ANGLE)					<*>
====================================================================

     This routine sets the chord angle
     for drawing arcs (circle, ellipse, etc).

     ANGLE --- chord angle.
     	       Valid range: 0.5 to 15 (default=5.0).
.el
.pg
.lt
====================================================================
subroutine  CIRCLE (XPOS,YPOS,RADIUS,THICK,ANGL1,ANGL2,IHP)
subroutine HCIRCLE (XPOS,YPOS,RADIUS,THICK,ANGL1,ANGL2,IHP)	<*>
====================================================================

     This routine draws a circle/arc/pies.

     	XPOS,YPOS --- centre of circle/arc/pie.
     	RADIUS ------ radius of circle/arc/pie.
     		      If RADIUS<0.0, a dash trace is drawn.
     	THICK ------- wall thickness (additive to RADIUS).
     	ANGL1 ------- starting angle to draw circle/arc/pie.
     	ANGL2 ------- additive angle to ANGL1.
     	IHP --------- hatching pattern code for area fill.
     		      Valid range: 0 to 17 (0=no area fill).
     		      If IHP>0 and THICK=0, fill the inner.
     		      If IHP>0 and THICK>0<, fill the wall.

====================================================================
subroutine  ELLIPS (XPOS,YPOS,RAD1,RAD2,THICK,ANGL0,ANGL1,ANGL2,IHP)
subroutine HELLIPS (XPOS,YPOS,RAD1,RAD2,THICK,ANGL0,ANGL1,ANGL2,IHP) <*>
====================================================================

     This routine draws an ellipse.

     	XPOS,YPOS --- centre of ellipse.
     	RAD1 -------- radius in x-dimension.
     		      If RAD1<0.0, a dash trace is drawn.
     	RAD2 -------- radius in y-dimension.
     	THICK ------- wall thickness (additive to RAD1,RAD2).
     	ANGL0 ------- rotation angle of ellipse from x-axis.
     	ANGL1 ------- starting angle to draw ellipse.
     	ANGL2 ------- additive angle to ANGL1.
     	IHP --------- hatching pattern code for area fill.
     		      Valid range: 0 to 17 (0=no area fill).
     		      If IHP>0 and THICK=0, fill the inner.
     		      If IHP>0 and THICK>0<, fill the wall.
.EL
.PG
.LT
====================================================================
subroutine  OBLICK (XPOS,YPOS,RAD1,RAD2,THICK,ANGLE,IHP)
subroutine HOBLICK (XPOS,YPOS,RAD1,RAD2,THICK,ANGLE,IHP)	<*>
====================================================================

     This routine draws an ellipse.

     	XPOS,YPOS --- centre of oblique.
     	RAD1 -------- radius in x-dimension.
     		      If RAD1<0.0, a dash trace is drawn.
     	RAD2 -------- radius in y-dimension.
     	THICK ------- wall thickness (additive to RAD1,RAD2).
     	ANGLE ------- rotation angle of oblique from x-axis.
     	IHP --------- hatching pattern code for area fill.
     		      Valid range: 0 to 17 (0=no area fill).
     		      If IHP>0 and THICK=0, fill the inner.
     		      If IHP>0 and THICK>0<, fill the wall.

====================================================================
subroutine  POLYGN (XPOS,YPOS,RADIUS,THICK,ANGLE,NSIDE,IHP)
subroutine HPOLYGN (XPOS,YPOS,RADIUS,THICK,ANGLE,NSIDE,IHP)	<*>
====================================================================

     This routine draws a polygon.

     	XPOS,YPOS --- centre of polygon.
     	RADIUS ------ radius of circumscribed circle.
     		      If RADIUS<0.0, a dash trace is drawn.
     	THICK ------- wall thickness (additive to RADIUS).
     	ANGLE ------- rotation angle of polygon from x-axis.
     	NSIDE ------- number of edges of polygon (3 to 99).
     	IHP --------- hatching pattern code for area fill.
     		      Valid range: 0 to 17 (0=no area fill).
     		      If IHP>0 and THICK=0, fill the inner.
     		      If IHP>0 and THICK>0<, fill the wall.

====================================================================
subroutine TKLOGO (XPOS,YPOS,SIZE)
subroutine HPLOGO (XPOS,YPOS,SIZE)				<*>
====================================================================

     This routine draws the AU logo of SIZE at (XPOS,YPOS).
.EL
