c      Must include MISCIOFI.FOR if output to LASERJET
c       INCLUDE 'MISCIOFI.FOR'
       INCLUDE 'STDHDR.FOR'


       REAL xdata(0: maxv)
       REAL ydata(0: maxv), rr
       INTEGER i, prnerr
C      ErrCode is used for Open_Com
c       INTEGER * 2 errCode

       DO i = 0, 50
         CALL Random(rr)
         xdata(i) = (4.0 * pi * (rr - 0.5))
         ydata(i) = 1000.0 * SIN(xdata(i))
       END DO

       CALL SortDataX(xdata, ydata, 50, 0)

       CALL InitSEGraphics( -1, 'C:\FOR\LIB\*.FON')
       CALL SetCurrentWindow(1)
       CALL ClearWindow
       CALL SetAxesType(0, 0)
       CALL SelectColor(7)
       CALL AutoAxes(xdata, ydata, 50, 0)
       CALL SelectColor(5)
       CALL LinePlotData(xdata, ydata, 50, 1, 0)
       CALL SelectColor(1)
       CALL TitleWindow('Hair Growth Study')
       CALL TitleXAxis('Before/After Injections')
       CALL TitleYAxis('Hair inches/wk.')

       CALL ClearWindow
       CALL SelectColor(7)
       CALL BorderCurrentWindow(15)
       CALL AutoAxes(xdata, ydata, 50, 1)
       CALL LinePlotData(xdata, ydata, 50, 2, 0)
       CALL SelectColor(1)
       CALL TitleWindow('Hair Growth Study')
       CALL TitleXAxis('Before/After Injections')
       CALL TitleYAxis('Hair inches/wk.')

! BE SURE YOU DO NOT CALL CLEAR WINDOW BEFORE YOU ATTEMPT
!  A SCREEN DUMP

! ** Use this sequence of commands for ScreenDump to serial
!    HP LaserJet
!       CALL Open_Com ( 0,9600,0,1,8,48,errCode)
!       CALL ScreenDump(3, 2, 2, 1.0, 1.0, 0,1, 0, prnerr)

! ** Use this sequence of commands for ScreenDump to parallel
!    HP LaserJet
!      CALL ScreenDump(3, 0, 2, 1.0, 1.0, 0, 1,0, prnerr)

! ** Use this sequence of commands for ScreenDump to parallel
!    Epson FX
      CALL ScreenDump(0, 0, 1, 1.5, 1.5, 0,1, 0, prnerr)

      READ (*,*)
      CALL ClearWindow
      CALL CloseSEGraphics

      END

