c	program main
c	call gset							!  enter graphic mode
c	call stat
c	call aset							!  return to alpha mode
c	end	
c	-----------------------------------------------------------------------
	subroutine stat
c
c	...example of histogram routine
c
c	(C) Copyright 1988, 1989 by Jim Farrell      All Rights Reserved.
c
	parameter (n=1000)
	real y(n)
c
	call putstr(10,20,' DEMONSTRATION OF HISTOGRAM PLOT')
	call putstr(12,20,'    OF UNIFORM RANDOM NUMBERS')
	call pause('WHEN READY ')				!  display message and pause
	call gcls
	krk=1
	do 250 i=1,n							!  generate random samples
		y(i)=rand(krk)
		if(mod(i,100).eq.0)then
			call cursor(1,1)
			write(*,*)' COUNT = ',i
		endif
250	continue
	call gcls									!  clear the screen
	call putstr(2,1,' GENERATED SAMPLES ')
	xmn=1.0
	xmx=real(n)
	call tplot(xmn,xmx,y,600,-1,2)				!  full screen tplot
	call pause('REVIEW PLOT')
	call gcls									!  clear the screen
	call putstr(2,1,' HISTOGRAM OF DISTRIBUTION ')
	call hist(y,n)								!  plot a histogram
	call pause('REVIEW PLOT')
	return
	end
