
      !!!   PROGRAM errordem

      INCLUDE 'STDHDR.FOR'


       INTEGER n,wc,i
       REAL rr, rand
       REAL xval(0:maxv), yval(0:maxv), y1val(0:maxv), y2val(0:maxv)

      n = 20
      DO i = 0, n-1
         rr = REAL(i)
         CALL random(rand)
         xval(i) = 4.0*pi*(rand-0.5)
         yval(i) =   rr - xval(i) * xval(i) *  rand
       END DO
       CALL sortdatax(xval,yval,n,0)
       DO i = 0, n-1
         y1val(i) = yval(i) - 1.0
         y2val(i) = yval(i) + 1.0
       END DO
      CALL InitSEGraphics(-1, 'C:\FOR\LIB\*.FON')
      DO wc = 1, 10
        CALL SetCurrentWindow(wc)
        CALL ClearWindow
        CALL SetAxesType(0,0)
        CALL SelectColor(15)
        CALL AutoAxes(xval,yval,n,MOD(wc, 2))
        CALL LinePlotData(xval, yval, n,3, 0)
        CALL ScatterPlotData(xval,yval,n,4,2)
        CALL PlotErrorBars(xval, y1val, y2val, n,0.4,5)

        CALL SelectColor(2)
        CALL SetTextStyleXX(0, 0, 10, 12)
        CALL TitleWindow('Error Bar Demo')
        CALL SetTextStyleXX(0,0,10, 12)
        CALL SelectColor(3)
        CALL TitleXAxis(' Independent Variable')
        CALL TitleYAxis(' Dep. Var.')
        READ (*,*)
        CALL ClearWindow
      END DO
      CALL CloseSEGraphics

      END
