C-AXIS SUBROUTINE  FOR OS/8 FORTRAN 4
C-
C-COPYRIGHT (C) 1973, 1975
C-DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
	SUBROUTINE AXIS(XAX,YAX,TITLE,NCHR,AXLEN,ANG,FV,DV)
	DIMENSION ARRAY(3)
        COMMON /AXISZZ/ SIZE,NDIG
C       
	DATA PFCT/'*10'/
        DATA SIZE,NDIG /0.21,2/
C       
	ICW=-1
	IF(NCHR.GE.0) ICW=1
	ZANG=ANG
4	IF(ZANG.LT.0)ZANG=ZANG+360
	IF(ZANG.GT.360)ZANG=ZANG-360
	IF(ZANG.GT.360).OR.(ZANG.LT.0)GO TO 4
	CALL XYPLOT(XAX,YAX,-3)
C-MOVE TO START OF AXIS
	XPT=ZANG*.017453294
	CANGL=COS(XPT)
	SANGL=SIN(XPT)
	AFV=.1*SANGL*ICW
	ADV=.1*CANGL*ICW
	XPT=0
	YPT=0
	IXLEN=ABS(AXLEN)
	DO 10 ICHAR=0,IXLEN  
	CALL XYPLOT(XPT,YPT,2)       
	XTIC=XPT-AFV          
	YTIC=YPT+ADV       
C-DRAW THE TIC MARKS
	CALL XYPLOT(XTIC,YTIC,2)
	CALL XYPLOT(XPT,YPT,3)
	XPT=CANGL*(ICHAR+1)
	YPT=SANGL*(ICHAR+1)
10	CONTINUE
	IEXP=1
	PWR=1
	AFV=ABS(FV)
	IF(AFV.EQ.0)AFV=ABS(DV)
	IF(AFV.GE.100) GO TO 30
	IF(AFV.LT.0.01) GO TO 40
C-IEXP=EXPONENT,PWR=POWER IN 10S
20	YTIC=(FV+(DV*IXLEN))/PWR
	XPT=CANGL*IXLEN-(.2*ICW-.05)*SANGL-.0857*CANGL
	YPT=SANGL*IXLEN+(.2*ICW-.05)*CANGL-.0857*SANGL
	DO 50 ICHAR=0,IXLEN
	CALL NUMBER(XPT,YPT,SIZE,YTIC,ZANG,NDIG)
C-LABEL THE TIC MARK
	XPT=XPT-CANGL
	YPT=YPT-SANGL
	YTIC=YTIC-DV/PWR
50	CONTINUE
	PWR=0
55	IF(IEXP/(10**PWR).LT.10)GO TO 60
	PWR=PWR+1
	GO TO 55
60	ICHAR=ABS(NCHR)
	IF(IEXP.GT.1)PWR=PWR+4
C-FOR THE 10* CHARACTERS. PWR = # DIGITS
	ADV=(IXLEN-(ICHAR+PWR)*.14)/2
	XTIC=ADV*CANGL-ICW*.6*SANGL
	YPT=ADV*SANGL+ICW*.6*CANGL
	CALL SYMBOL(XTIC,YPT,.14,TITLE,ZANG,ICHAR)
C-PRINT THE TITLE
	IF(IEXP.LE.1) GO TO 70
	CALL WHERE(XTIC,YTIC,XPT)
	CALL SYMBOL(XTIC,YTIC,.14,PFCT,ZANG,3)
	IF(AFV.LT..01)IEXP=-IEXP+2
	CALL WHERE(XTIC,YTIC,XPT)
	CALL NUMBER(XTIC-.09*SANGL,YTIC+.09*CANGL,.14,IEXP-1,ZANG,-1)
C-PRINT THE EXPONENT
70	CALL XYPLOT(-XAX,-YAX,-3)
   	RETURN
30	XTIC=AFV/PWR
	IF(XTIC.LT.100) GO TO 20
	PWR=AINT(PWR*10)
	IEXP=IEXP+1
	GO TO 30
40	XTIC=AFV*PWR
	IF(XTIC.GE.0.01)GO TO 45
	PWR=PWR*10
	IEXP=IEXP+1
	GO TO 40
45	PWR=1/PWR
C-FOR THE DIVISION ABOVE
	GO TO 20
	END
