C
C SUBROUTINE 'QGYAX1'
C ===================
C
C A SIMPLE 'Y' AXIS DRAWING ROUTINE
C
      SUBROUTINE QGYAX1 (XO,YO,YLEN,YMIN,YMAX,NYDIV,ND,HT,SIZ)
C
C PARAMETERS
C
C       XO (I)   X ORIGIN COORDINATE IN PIXELS 0.0 TO 1023.0 (OR MAPPED 
C                         COORDINATE IF 'QGMAPC' HAS BEEN CALLED)
C       YO (I)   Y ORIGIN COORDINATE IN PIXELS 0.0 TO 767.0 (OR MAPPED 
C                         COORDINATE IF 'QGMAPC' HAS BEEN CALLED)
C     YLEN (I)   LENGTH OF Y AXIS IN SCREEN PIXELS (1.0-767.0) (OR MAPPED
C                         COORDINATE SPACE IF 'QGMAPC' HAS BEEN CALLED)
C     YMIN (I)   MINIMUM Y VALUE AT 'Y' ORIGIN
C     YMAX (I)   MAXIMUM Y VALUE 
C    NYDIV (I)   NUMBER OF Y DIVISIONS FOR ANNOTATION (0 IF NONE)
C       ND (I)   NUMBER OF DIGITS AFTER DECIMAL POINT (MAX 9, 0=INTEGERS)
C       HT (I)   HALFWIDTH OF AXIS TICK LINES (IN PIXELS) (0.0 IF NONE)
C      SIZ (I)   CHARACTER SIZE (HEIGHT) IN PIXELS (0.0 IF NO ANNOTATION
C                REQUIRED)
C
C SPECIFICATION STATEMENTS
C ------------------------
C
      LOGICAL START, MAPSAV
      CHARACTER*8 FORM
      CHARACTER*25 DIGSTR
      LOGICAL MAP
      COMMON /QQMAP/ MAP, XPMIN, XPMAX, YPMIN, YPMAX, 
     *               XMMIN, XMMAX, YMMIN, YMMAX, XSC, YSC
      SAVE /QQMAP/
      DATA FORM/'(F20.X)'/
C
C INITIALISATIONS
C ---------------
C
      CALL QGMPXY (XO,YO,XPO,YPO)
      IF (MAP) THEN
         YPLEN = YLEN*YSC
      ELSE
         YPLEN = YLEN
      ENDIF
      MAPSAV = MAP
      MAP = .FALSE.
      NDEC=ND
      IF (NDEC.GT.9) NDEC=9
      IF (NDEC.LT.0) NDEC=0
      IF (NDEC.GT.0) WRITE (FORM(6:6),'(I1)') NDEC
      CHW = 0.6*SIZ
      CHYOFF = 0.375*SIZ
C
C DRAW AXIS LINE
C --------------
C
      CALL QGMOVE (XPO,YPO)
      CALL QGDRAW (XPO, (YPO+YPLEN))
C
C DRAW TICKS
C ----------
C
      IF (NYDIV.GT.0.AND.HT.GT.0.0) THEN
         DO 100 I=0,NYDIV
            YY = YPO+I*(YPLEN/NYDIV)
            CALL QGMOVE (XPO-HT,YY)
            CALL QGDRAW (XPO+HT,YY)
100      CONTINUE
      ENDIF
C
C DRAW ANNOTATION VALUES
C ----------------------
C
      IF (NYDIV.GT.0.AND.SIZ.GT.0) THEN
         DO 250 I=0,NYDIV
            YVAL = YMIN + I*(YMAX-YMIN)/NYDIV
            IF (NDEC.EQ.0) THEN
               WRITE (DIGSTR,'(I20)') NINT(YVAL)
            ELSE
               WRITE (DIGSTR,FORM) YVAL
            ENDIF
            START=.FALSE.
            CHX = XPO - CHW/2.0
            CHY = YPO + I*(YPLEN/NYDIV) - CHYOFF
            DO 200 J=25,1,-1
               IF (START.AND.DIGSTR(J:J).EQ.' ') GO TO 250
               IF (DIGSTR(J:J).EQ.' ') GO TO 200
               START = .TRUE.
               CHX = CHX - CHW
               CALL QGTEXT (CHX, CHY, SIZ, DIGSTR(J:J))
200         CONTINUE
250      CONTINUE
      ENDIF
      MAP = MAPSAV
      RETURN
      END
