      SUBROUTINE TK4025(X,Y,IND)
C
C         Notice of Public Domain nature of this Program
C
C      'This computer program is a work of the United States 
C       Government and as such is not subject to protection by 
C       copyright (17 U.S.C. # 105.)  Any person who fraudulently 
C       places a copyright notice or does any other act contrary 
C       to the provisions of 17 U.S. Code 506(c) shall be subject 
C       to the penalties provided therein.  This notice shall not 
C       be altered or removed from this software and is to be on 
C       all reproductions.'
C
      INCLUDE 'SIZES'
      CHARACTER*1 CCHAR
      COMMON/ OUTPUT/ IPAPER,IPAGE
      COMMON /DEVICE/ ITYPE, ISCRN, KOROFF
      INTEGER PIXROW, PIXCOL, PIXEL
      COMMON /TERM/ IMAXR, IMAXC, PIXROW, PIXCOL, PIXEL, LCOUNT, INGRAF,
     .              IXL, IXR, IYT, IYB, NCOLOR, MCOLOR( 64 ), ITTRM,
     .              MARGX, MARGY
* VARIABLES IN COMMON TERM:
*  IMAXR = MAX NUMBER OF ROWS
*  IMAXC = MAX NUMBER OF COLUMNS
*  PIXROW = NUMBER OF PIXELS PER ROW
*  PIXCOL = NUMBER OF PIXELS PER COLUMN
*  PIXEL  = LESSER OF PIXROW OR PIXCOL
*  LCOUNT = NUMBER OF LINES CURRENTLY WRITTEN TO DIALOG AREA
*  INGRAF = 0=> HOST TEXT GOES TO MONITOR SPACE\\ 1=> TEXT TO GRAPHICS
*  IXL    = LEFT MOST VALUE OF X
*  IXR    = RIGHT MOST VALUE OF X
*  IYT    = VALUE OF Y AT TOP OF SCREEN
*  IYB    = VALUE OF Y AT BOTTOM OF SCREEN
*  NCOLOR = NUMBER OF COLORS IN MCOLOR MAP
*  MCOLOR = MAP OF COLORS
*  ITTRM  = UNIQUE MODEL NUMBER OF GENERAL TERMINAL TYPE
*  MARGX  = NUMBER OF PIXELS PADDED TO X-COORDINATE
*  MARGY  = NUMBER OF PIXELS PADDED TO Y-COORDINATE
*
*
C ****   THE FOLLOWING STATEMENT SHOULD BE CHANGED FOR THE
C        SPECIFIC COMMAND CHARACTER USED ON YOUR TEKTRONIX 4025
C
      DATA CCHAR/'!'/

C
C   CODES FOR IND:
C
C     IND = 0   =>  REMOVE ALL GRAPHICS TO QUIT
C     IND = 1   =>  ANY ONE TIME ONLY INITIALIZATION
C     IND = 2   =>  MOVE GRAPHICS TO POINT (X,Y) -- DO NOT DRAW LINE
C     IND = 3   =>  DRAW LINE FROM LAST POINT TO NEW (X,Y)
C     IND = 4   =>  DRAW DARK LINE
C     IND = 5   =>  DRAW BRIGHT SOLID LINE
C     IND = 6   =>  INITIALIZE & SET-UP FOR NEXT PICTURE
C     IND = 8   =>  TEMPORARY RELEASE FROM GRAPHICS
C     IND = 9   =>  RETURN TO GRAPHICS FROM TEMP RELEASE
*     IND = 10  =>  DONE DRAWING PICTURE
C
*     IND = 99  =>  COLOR CHANGE (NOT USED HERE)
*
      PIXEL=380. * IPAGE / 100.
C
      IF (IND.EQ.0) THEN
C  ALL DONE -- CLEAR TERMINAL AND WE WILL QUIT
         WRITE ( *, *) CCHAR//'WOR 0'
         WRITE ( *, *) CCHAR//'ERA'
      ELSEIF (IND.EQ.1) THEN
C  ONE TIME ONLY INITIALIZATION OF TRMINAL  (IF NEEDED)
         ISCRN = 26
C?         KOROFF = 1
         NCOLOR = 0
         WRITE ( *, *) CCHAR//'WOR 0'
         WRITE ( *, *) CCHAR//'ERA'
         WRITE ( *, *) CCHAR//'WOR 30 H'
         WRITE ( *, *) CCHAR//'MON K'
      ELSEIF (IND.EQ.2 ) THEN
         IXLX = X * PIXEL
         IYLY = Y * PIXEL
         IXLAST = IXLX
         IYLAST = IYLY
      ELSEIF (IND .EQ. 3) THEN
C DRAW LINE FROM LAST POINT TO NEW POINT
         IXLX = X * PIXEL
         IYLY = Y * PIXEL
         WRITE (6,100) CCHAR,IXLAST,IYLAST,IXLX,IYLY
100      FORMAT (' ',A1,'VEC',I3,',',I3,',',I3,',',I3)
         IXLAST = IXLX
         IYLAST = IYLY
      ELSEIF (IND .EQ. 4) THEN
         WRITE (*,*) CCHAR//'LIN E'
      ELSEIF (IND .EQ. 5) THEN
         WRITE (*,*) CCHAR//'LIN 1'
      ELSEIF (IND.EQ.6) THEN
C  INITIALIZE FOR DRAWING NEXT PICTURE
         WRITE ( *, *) CCHAR//'WOR 30 H'
         WRITE ( *, *) CCHAR//'ERA'
         WRITE ( *, *) CCHAR//'GRA 1,25'
         WRITE ( *, *) CCHAR//'MON K'
         WRITE ( *, *) CCHAR//'JUM'
      ELSEIF (IND.EQ.8) THEN
C TEMPORARY RELEASE FROM GRPHICS  (USUALLY FOR TEXT)
         WRITE ( *, *) CCHAR//'MON H K'
      ELSEIF (IND.EQ.9) THEN
C RETURN TO GRAPHICS FROM TEMPORARY RELEASE
         WRITE ( *, *) CCHAR//'WOR H'
      ELSEIF (IND.EQ.10) THEN
C DONE DRAWING PICTURE
         WRITE ( *, *) CCHAR//'MON H K'
         WRITE ( *, *) CCHAR//'ERA M'
      ELSEIF ( IND.EQ.99) THEN
* REQUEST TO CHANGE COLOR OF LINES
         CONTINUE
      ELSE
C WE HAVE AN ERROR IN IND
         WRITE ( *, *) ' ERROR IN PLOT, IND=',IND
      ENDIF
      RETURN
      END
