home *** CD-ROM | disk | FTP | other *** search
- subroutine axis(x,y,lbl,nc,s,theta,amin,delta)
- save
- c
- c this subroutine draws an axis with "tic" marks at one inch
- c intervals with their associated values and addelta a label.
- c the arguments are:
- c x,y = the coordinates in inches of the starting point of
- c the axis
- c lbl = a holerith string that will be used as the axis label
- c it is centered and drawn in 0.14 inch high letters.
- c nc = number of characters in lbl. if pos, label, scale, &
- c tic marks are drawn on ccw side of the axis. if neg,
- c they are placed on the cw side.
- c s = the length of the axis in inches.
- c theta = the angle in degrees from the +x direction that the
- c axis is drawn. =0 implies a horizontal axis reading
- c left to right. =90 implies a verticle axis reading
- c bottom to top.
- c amin = the minimum value shown on the axis.
- c delta = the scale increment per inch on the scale.
- c
- dimension lbl(1) , jdl(1)
- c
- c nn =specifies the number of digits affter the decimal
- c point on numeric lettering. calcomp versions allow
- c only 2 positions after the decimal.
- c
- data nn/2/,jdl/4h *10/
- xb=x
- yb=y
- ymin=amin
- n=s+.5
- nac=iabs(nc)
- yyd=.5*s-.06*nac
- angrad=1.7453293e-2*theta
- f=cos(angrad)
- g=sin(angrad)
- sgn=isign(1,nc)
- fsv=sgn*f
- gsv=sgn*g
- t=-.07*(sgn-1.)
- shftx=t*gsv
- shfty=t*fsv
- xa=xb-.1*gsv
- ya=yb+.1*fsv
- xc=xb-.15*gsv-.17*f-shftx
- yc=yb+.15*fsv-.17*g+shfty
- xd=xb+yyd*f-.33*gsv-shftx
- yd=yb+yyd*g+.33*fsv+shfty
- exp=0.
- dd=abs(delta)
- if (dd.ge..01.and.dd.le.100.) go to 50
- nac=nac+4
- 10 if (dd.lt..01) go to 40
- 20 if (dd.gt.100.) go to 30
- go to 50
- 30 dd=dd*.1
- ymin=ymin*.1
- exp=exp+1.
- go to 20
- 40 dd=dd*10.
- ymin=ymin*10.
- exp=exp-1.
- go to 10
- 50 call number(xc,yc,.105 ,ymin,theta,nn)
- dd=sign(dd,delta)
- do 60 i = 1,n
- call plot(xa,ya,1)
- call plot(xb,yb,2)
- xa=xa+f
- xb=xb+f
- xc=xc+f
- ya=ya+g
- yb=yb+g
- yc=yc+g
- ymin=ymin+dd
- call plot(xb,yb,1)
- call plot(xa,ya,1)
- 60 call number(xc,yc,.105,ymin,theta,nn)
- if (exp) 80,70,80
- 70 call symbol(xd,yd,.14,lbl,theta,nac)
- return
- 80 ncc=nac-4
- call symbol(xd,yd,.14,lbl,theta,ncc)
- call where(aa,bb,fact)
- call symbol(aa,bb,.14,jdl,theta,4)
- call where(aa,bb,fact)
- aa=aa+cos(angrad)*(.08)-sin(angrad)*.08
- bb=bb+sin(angrad)*(.08)+cos(angrad)*.08
- call number(aa,bb,.07,exp,theta,-1)
- return
- end
-