      PROGRAM GPE6
      DIMENSION X(100),Y(100),Y2(100),Y3(100),EY(100),EX(100)
      INTEGER IPKRAY(100)
      DATA XORIG,DX,XMAX/0.0,100.,1000./,YORIG,DY,YMAX/0.0,100.0,1000.0/
      CALL ORIENT('PORTRAIT')      ! Draw in portrait orientation
      CALL GSTART                  ! Nominate graphics device
      CALL PAGE(8.5,11.0)          ! Define Page size/aspect ratio
      CALL FONT('AvantGarde','NORMAL')! Select Text Font
	CALL NOBRDR
      CALL AREA2D(6.5,8.5)         ! Define Plot Area
      CALL XNAME('X LABEL$',100)   ! Define X Axis label
      CALL YNAME('Y LABEL$',100)   ! Define Y Axis label
      CALL HEADIN('Example Plot 6$',100,2.,2)
      CALL HEADIN('Curves with error bars and a Legend$',100,1.5,2)
      CALL GRAF (XORIG,DX,XMAX,YORIG,DY,YMAX)
      ISEED = 65535		! Initialize seed to large odd number
      DO I=1,100                   ! Compute three curves
        X(I) = I*10.0
        Y(I) = 0.1*I*I
        Y2(I) = X(I)
        ARG = 0.05*(I-1)
        Y3(I) = 1000.*EXP(-ARG)
	EX(I) = 0.02*XMAX*RAN(ISEED)
	EY(I) = 0.05*YMAX*RAN(ISEED)
      END DO
      CALL MYLEGN('Legend Heading$',100)     ! Define legend heading
      CALL LINES('Quadratic curve$',IPKRAY,1)        ! Define first curve label
      CALL EXYCRV(X,Y,100,5,EX,EY)        ! Draw first curve
      CALL LINES('Linear Curve$',IPKRAY,2)   ! Define second curve label
      CALL DASH                    ! Use dashed line for second curve
      CALL NEWCLR('BLUE')           ! Make second  curve blue
      CALL EYCRV(X,Y2,100,5,EY)       ! Draw second curve with error bars
      CALL LINES('Exponential Curve$',IPKRAY,3)      ! Define third curve label
      CALL DOT                     ! Use dotted line for third curve
      CALL NEWCLR('RED')           ! Make third curve red
      CALL EXCRV(X,Y3,100,5,EX)       ! Draw third curve
      CALL LEGEND(IPKRAY,3,1.5,4.0)
      CALL ENDPL(0)                ! Terminate this plot
      CALL GSTOP
      CALL EXIT
      END
