home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8710 / 14 / line.f < prev    next >
Encoding:
Text File  |  1990-07-13  |  1.5 KB  |  51 lines

  1.       subroutine  line(xa,ya,n,k,ltype,inum)
  2.     save
  3. c
  4. c                draw line connecting data point coordinates array value
  5. c                ** xa(n*k+1)  must contain minimum x scale value (inch)
  6. c                ** ya(n*k+1)                       y
  7. c                ** xa(n*k+k+1)  must contain delta x value (per inch)
  8. c                ** ya(n*k+k+1)                     y
  9. c
  10.       dimension  xa(1),ya(1)
  11. c                   ns= count to plot symbol
  12. c                   il= flag to plot line
  13. c                   is= flag to plot symbol
  14. c                  lim= last (x,y) point to plot
  15.       ns= iabs(ltype)
  16.       il= 0
  17.       if(ltype.ge.0)  il=1
  18.       is= 1
  19.       if(ltype.eq.0)  is=0
  20.       lim=  n*k
  21.       xmin=  xa(lim+1)
  22.       ymin=  ya(lim+1)
  23.       xinc=  xa(lim+k+1)
  24.       yinc=  ya(lim+k+1)
  25. c                                  pen up to 1st point
  26.       x =  (xa(1)-xmin) / xinc
  27.       y =  (ya(1)-ymin) / yinc
  28.       call  plot (x,y, 3)
  29. c                             plot array of (x,y) coord. points
  30.       if (il.eq.0) go to 20
  31.       do 10 i = 1,lim,k
  32.        x= (xa(i)-xmin)/ xinc
  33.        y= (ya(i)-ymin)/ yinc
  34. c                                       plot line
  35.        call  plot (x,y,2)
  36.    10 continue
  37. c
  38.    20 if (is.eq.0) go to 40
  39.       j=1
  40.       do 30 i = 1,lim,k
  41.        j= j-1
  42.       if (j.gt.0) go to 30
  43.        j= ns
  44.        x= (xa(i)-xmin)/ xinc
  45.        y= (ya(i)-ymin)/ yinc
  46. c                                       plot  symbol
  47.        call  symbol (x,y,.08 ,inum,0.0, -1)
  48.    30 continue
  49.    40 return
  50.       end
  51.