home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / grafx.zip / STAT.FOR < prev    next >
Text File  |  1989-03-14  |  1KB  |  40 lines

  1. c    program main
  2. c    call gset                            !  enter graphic mode
  3. c    call stat
  4. c    call aset                            !  return to alpha mode
  5. c    end    
  6. c    -----------------------------------------------------------------------
  7.     subroutine stat
  8. c
  9. c    ...example of histogram routine
  10. c
  11. c    (C) Copyright 1988, 1989 by Jim Farrell      All Rights Reserved.
  12. c
  13.     parameter (n=1000)
  14.     real y(n)
  15. c
  16.     call putstr(10,20,' DEMONSTRATION OF HISTOGRAM PLOT')
  17.     call putstr(12,20,'    OF UNIFORM RANDOM NUMBERS')
  18.     call pause('WHEN READY ')                !  display message and pause
  19.     call gcls
  20.     krk=1
  21.     do 250 i=1,n                            !  generate random samples
  22.         y(i)=rand(krk)
  23.         if(mod(i,100).eq.0)then
  24.             call cursor(1,1)
  25.             write(*,*)' COUNT = ',i
  26.         endif
  27. 250    continue
  28.     call gcls                                    !  clear the screen
  29.     call putstr(2,1,' GENERATED SAMPLES ')
  30.     xmn=1.0
  31.     xmx=real(n)
  32.     call tplot(xmn,xmx,y,600,-1,2)                !  full screen tplot
  33.     call pause('REVIEW PLOT')
  34.     call gcls                                    !  clear the screen
  35.     call putstr(2,1,' HISTOGRAM OF DISTRIBUTION ')
  36.     call hist(y,n)                                !  plot a histogram
  37.     call pause('REVIEW PLOT')
  38.     return
  39.     end
  40.