      !!! PROGRAM bardem

      INCLUDE 'STDHDR.FOR'

      INTEGER n, wc, i
      REAL rr
      REAL xdata(0:maxv), ydata(0:maxv)



      n = 50
      DO i = 0, n-1
       CALL Random(rr)
       xdata(i) = (4.0*pi* (rr-0.5)) + 6.0
       ydata(i) = 25.0*(1.0/(sqrt(2*pi*9.0)))*
     +           exp(-((xdata(i)**2)/(18.0)))

      END DO
      CALL InitSEGraphics(-1,'C:\FOR\LIB\*.FON')
      DO wc = 1, 6
        CALL SetCurrentWindow(wc)
        CALL SetAxestype(0,0)
        CALL SelectColor(7)
        CALL AutoAxes(xdata,ydata,n,1)
        CALL BargraphData(xdata, ydata, n, 0.50,2,4)
        CALL SelectColor(3)
        CALL DrawGrid(5)
        CALL SelectColor(1)
        CALL TitleWindow('College Drinking Study')
        CALL TitleXAxis('Beers/Day')
        CALL TitleYAxis('GPA')
        READ (*,*)

        IF (wc .EQ. 4) then
          CALL ClearWindow
          CALL SetCurrentWindow(3)
          CALL ClearWindow
        END IF
        IF (wc .EQ. 1 .OR. wc .EQ. 2) CALL ClearWindow
      END DO
      CALL CloseSEGraphics

      END
