      INCLUDE 'STDHDR.FOR'
      INCLUDE 'GRAFTYPE.FOR'

      INTEGER  wc,k,i
      REAL rand
      REAL xdata(0:maxv)
      RECORD /GroupInfoRec/ fill(0: maxgroup)
      RECORD /GroupInfoRec/ Legendfill(0:MaxLegends)
      REAL GroupData(0:maxgroup, 0:maxv)
      CHARACTER * 80 XStrings(0:maxgroup)
      CHARACTER * 80 legendstrings(0:20)
      LOGICAL BW


      CALL InitSEGraphics(-1, 'C:\FOR\LIB\*.FON')
      DO i = 0, 4
        DO k = 0, 11
          xdata(k) =  Real(k)+1
          CALL Random(rand)
          GroupData(i,k) = 75.0 * rand
       END DO
      END DO
      DO i = 0, 4
        fill(i).groupcolor = i+1
        fill(i).grouphatch = i+1
        Legendfill(i).groupcolor = i+1
        Legendfill(i).grouphatch = i+1
      END DO
      CALL BlackAndWhite(Bw)
      LegendStrings(0) = 'Monday'
      LegendStrings(1) = 'Tuesday'
      LegendStrings(2) = 'Wednesday'
      LegendStrings(3) = 'Thursday'
      LegendStrings(4) = 'Friday'
      CALL SetPercentWindow( 0.05,0.90,0.95,0.99,3)


      DO wc = 1, 2
        CALL SetCurrentWindow(wc)
        CALL ClearWindow
        CALL SetAxesType(0, 0)
        CALL ScalePlotArea(0.0, 0.0, 5.5, 300.0)
        CALL SetXYIntercepts(0.0, 0.0)
        XStrings(0) = 'Lisa'
        XStrings(1) = 'Rick'
        XStrings(2) = 'Amy'
        XStrings(3) = 'Rich'
        XStrings(4) = 'Flo'
        CALL SelectColor(1)
        CALL DrawXAxis(1.0, 0)
        CALL LabelXAxWithStrings(1, XStrings, 5, 0)
        CALL DrawYAxis(20.0, 0)
        CALL LabelYAxis(5, 0)
        CALL GroupPlotData(xdata, GroupData, 10, 5, 0, 0.75, fill)
        CALL SetTextStyleXX(0, 0, 16,18)
        CALL TitleWindow('Ratologist Studies')
        CALL SetTextStyleXX(0, 0, 10, 12)
        CALL TitleXAxis('Ratologist')
        CALL TitleYAxis('# Rats/wk.')
        READ (*,*)
        CALL ClearWindow

         CALL SetCurrentWindow(wc)
         CALL ClearWindow

         IF (.NOT. BW) CALL SetViewBackground(15)
         CALL SetAxesType(0, 0)
         CALL ScalePlotArea(0.0, 0.0, 5.5, 300.0)
         CALL SetXYIntercepts(0.0, 0.0)
         CALL GroupPlotData(xdata, GroupData, 10, 5, 1, 0.75, fill)
         CALL SelectColor(1)
         CALL DrawXAxis(1.0, 0)
         CALL LabelXAxWithStrings(1, XStrings, 5, 0)
         CALL SelectColor(1)
         CALL DrawYAxis(20.0, 0)
         CALL DrawGridY(5)
         CALL LabelYAxis(5, 0)
         CALL TitleWindow('Ratologist Studies')
         CALL TitleXAxis('Ratologist')
         CALL TitleYAxis('# Rats/wk.')
         IF (wc .EQ. 1) THEN
           CALL SetCurrentWindow(3)
           CALL BorderCurrentWindow (5)
           CALL StringLegends(LegendStrings, Legendfill, 5, 1)
         END IF
         READ (*,*)
         CALL ClearWindow


         CALL SetCurrentWindow(wc)
         CALL ClearWindow
         IF (.NOT. BW) CALL SetViewBackground(15)
         CALL ScalePlotArea(0.0, 0.0, 5.5, 100.0)
         CALL SetXYIntercepts(0.0, 0.0)
         CALL SelectColor(1)
         CALL DrawXAxis(1.0, 0)
         CALL LabelXAxWithStrings(1, XStrings, 5, 0)
         CALL SelectColor(1)
         CALL DrawYAxis(10.0, 0)
         CALL LabelYAxis(2, 0)
         CALL TitleXAxis('Ratologist')
         CALL TitleYAxis('# Rats/wk.')
         CALL TitleWindow('Ratologist Studies')
         CALL GroupPlotData(xdata, GroupData, 10, 5, 2, 0.75, fill)
         IF (wc .EQ. 1) THEN
           CALL SetCurrentWindow(3)
           CALL BorderCurrentWindow(5)
           CALL StringLegends(LegendStrings, Legendfill, 5, 0)
         END IF
         READ (*,*)
         CALL ClearWindow
      END DO
      CALL CloseSEGraphics


      END
