      SUBROUTINE XYPLOT(X,Y,NPTS,LABEL,NC,LBLX,LBLY,
     1                  SCALF,IEZ,XLO,XHI,YLO,YHI)

C     * MAR 11/2004 - M.BERKLEY (MODIFIED for NCAR V3.2)
C     * DEC 10/91 - T. JANG (DECLARED LBLX AND LBLY CHARACTER*8, REPLACED ENCODE
C     *                      WITH AN INTERNAL WRITE TO CHARACTER VARIABLE LBLPT)
C     * AUG  1/91 - S. WILSON (MODIFY FOR BETTER USE OF AUTOGRAPH)
C     * JUL 14/89 - H. REYNOLDS (UPDATE TO NCAR GRAPHICS V2.0)
C     * CCRN APR  2/81 - R.LAPRISE. 
C     * DRAWS AN X-Y PLOT AND LABELS IT.
C     * IF IEZ  = .TRUE. , THE FOUR CORNERS OF GRAPH ARE COMPUTED AS TO 
C     * FILL THE PICTURE.  OTHERWISE THE LIMITS ARE XLO,XHI,YLO,YHI.
C  NOTE: SUBROUTINE SHORTN MUST BE CALLED BEFORE CALLING XYPLOT SO THAT NC, 
C        THE NUMBER OF CHARACTERS IN THE TITLE, MAY BE FOUND. 
C 
      LOGICAL IEZ 
      CHARACTER LABEL*83, LBLX*8, LBLY*8, LBLPT*3,NCHAR*1
      REAL X(NPTS),Y(NPTS)
C 
      DATA NCHAR/'*'/ 
C-----------------------------------------------------------------------
C     * SCALE DATA. 
C 
      DO 50 N=1,NPTS
           X(N)=X(N)*SCALF
           Y(N)=Y(N)*SCALF
   50 CONTINUE
C 
C     * SUPRESS THE FRAME ADVANCE.
C 
      CALL AGSETF('FRAME.', 2.0)
  
C 
C     *  MAKE THE NUMERIC LABELS BIGGER.
C     *  (NOTE:  THIS DOES NOT SET THE CHARACTERS TO A FIXED SIZE.
C     *  IF THE NUMBERS BECOME TOO LONG, EZXY WILL SHRINK THE 
C     *  CHARACTER SIZES SO THAT THEY FIT.) 
C 
      CALL AGSETF('LEFT/WIDTH/MANTISSA.', 0.02) 
      CALL AGSETF('LEFT/WIDTH/EXPONENT.', 0.013333) 
      CALL AGSETF('BOTTOM/WIDTH/MANTISSA.', 0.02) 
      CALL AGSETF('BOTTOM/WIDTH/EXPONENT.', 0.013333) 
  
C 
C     * MAKE THE TOP LABEL BIGGER.
C 
      CALL AGSETC('LABEL/NAME.', 'T') 
      CALL AGSETF('LINE/NUMBER.', 100.0)
      CALL AGSETF('LINE/CHARACTER.', 0.026666)
  
C 
C     * MAKE THE BOTTOM LABEL BIGGER. 
C 
      CALL AGSETC('LABEL/NAME.', 'B') 
      CALL AGSETF('LINE/NUMBER.', -100.0) 
      CALL AGSETF('LINE/CHARACTER.', 0.020) 
  
C 
C     * MAKE THE LEFT LABEL BIGGER. 
C 
      CALL AGSETC('LABEL/NAME.', 'L') 
      CALL AGSETF('LINE/NUMBER.', 100.0)
      CALL AGSETF('LINE/CHARACTER.', 0.020) 
  
  
      IF (IEZ) THEN 
           XLO = 1.E36
           XHI = 1.E36
           YLO = 1.E36
           YHI = 1.E36
      ENDIF 
  
  
C 
C     * SET LIMITS. 
C 
      CALL AGSETF('X/MAXIMUM.', XHI)
      CALL AGSETF('X/MINIMUM.', XLO)
      CALL AGSETF('Y/MAXIMUM.', YHI)
      CALL AGSETF('Y/MINIMUM.', YLO)
  
  
      CALL ANOTAT(LBLX, LBLY, 0., 0., 0., 0.) 
      CALL AGSETI('LINE/MAXIMUM.', NC-3)
  
      CALL EZXY(X, Y, NPTS, LABEL(4:NC))
  
C 
C     * LABEL EACH POINT OF GRAPH, FROM 0 TO NPTS-1.
C 
      DO 300 N=1,NPTS 
           NM1=N-1
           IF(NM1.LE. 9)WRITE(LBLPT,6005)NCHAR,NM1 
           IF(NM1.GE.10)WRITE(LBLPT,6010)NCHAR,NM1 
           CALL PWRITY(X(N),Y(N),LBLPT,3,1,0,0) 
  300 CONTINUE
  
C 
C     * INDICATE END OF PLOT. 
C 
      CALL SET(0.,1.,0.,1.,0.,1.,0.,1.,1) 
      CALL PWRITY(0.95,0.95,'X',1,0,0,0)
      CALL FRAME
      RETURN
 6005 FORMAT(A1,I1) 
 6010 FORMAT(A1,I2) 
      END 
