PROGRAM SIMPLE
      INTEGER I, IER, PGBEG
	character a;
      REAL XR(100), YR(100)
      REAL XS(5), YS(5)
      DATA XS/1.,2.,3.,4.,5./
      DATA YS/1.,4.,9.,16.,25./
      IER = PGBEG(0,'/xwin',1,1)
      IF (IER.NE.1) STOP

      print *, 'Use the cursor to draw a polygon'
      print *, 'Type A to add point, D to delete, X to exit'
      print *, 'A=left mouse button, D=middle, X=right'
      
      call pgpage
      NPT = 0
      CALL PGolin (50, NPT, Xr, Yr, 0)
      IF (NPT.GE.3) CALL PGPOLY (NPT, Xr, Yr)
      call pgpage
      NPT = 0
      CALL PGncur (50, NPT, Xr, Yr, 0)
      IF (NPT.GE.3) CALL PGPOLY (NPT, Xr, Yr)
      call pgpage
      NPT = 0
      CALL PGlcur (50, NPT, Xr, Yr, 0)
      IF (NPT.GE.3) CALL PGPOLY (NPT, Xr, Yr)

      CALL PGEND
      END
