      SUBROUTINE PLOTEPH(E,OMINC,N,EE,C,NN,TITLE)
C     
C     ROUTINE TO PLOT: E vs O-C
C     
      COMMON /PLOTFL/PLNAME
      COMMON /PGPL/PGPLDEV,IPGPL
      CHARACTER PLNAME*12, PGPLDEV*80
      DIMENSION E(*),OMINC(*),EE(*),C(*)
      CHARACTER TITLE*80,YTITLE*20,XTITLE*20 
      YL=4.0
      XL=6.0
C
C     INITIALISE THE PLOTTING
C
      IF(IPGPL.EQ.0)THEN
        IPGPL=1          
        CALL PGBEG(0,PGPLDEV,1,1)
      END IF
      CALL PGSCH(1.2)   
      CALL PGSLW(2)                      
      IF(INDEX(PGPLDEV,'/VPS') .NE.0.OR.
     *   INDEX(PGPLDEV,'/XWIN').NE.0)THEN
        CALL PGSVP(0.20,0.85,0.2,0.6)
      END IF
      IF(INDEX(PGPLDEV,'/PS').NE.0)THEN
        CALL PGSVP(0.3,0.8,0.25,0.85)
      END IF
      XMIN=1.0E30
      XMAX=-1.0E30
      YMIN=1.0E30
      YMAX=-1.0E30
      DO J=1,N
        IF(XMIN.GT.E(J))XMIN=E(J)
        IF(XMAX.LT.E(J))XMAX=E(J)
        IF(YMIN.GT.OMINC(J))YMIN=OMINC(J)
        IF(YMAX.LT.OMINC(J))YMAX=OMINC(J)
      END DO 
      XRANGE=XMAX-XMIN
      XMIN=XMIN-0.05*XRANGE
      XMAX=XMAX+0.05*XRANGE
      XRANGE=XMAX-XMIN
      XTITLE='CYCLE'     
      YTITLE='O-C  (CYCLES)'    
      IF(ABS(YMIN).LT.0.002.AND.ABS(YMAX).LT.0.002)THEN
        YMIN=-0.002        
        YMAX=0.002          
      END IF
      CALL PGSWIN(XMIN,XMAX,YMIN,YMAX)
      CALL PGBOX('BCNTS1',0.0,0,'BCNTSV',0.0,0)
      CALL PGLAB(XTITLE,YTITLE,TITLE)
      CALL PGSCH(0.7)
      INDX=17
      DO 10 J=1,N  
        CALL PGPT(1,E(J),OMINC(J),INDX)
   10 CONTINUE    
      CALL PGLINE(NN,EE,C)     
      CALL PGPAGE              
      RETURN
      END   
