        SUBROUTINE PLOT_XY_JOIN(LUS,XAX,DATA,NCHAN,X,Y)
C
C----------------------------------------------------------------------
C.IDENTIFICATION: Subroutine PLOT_XY_JOIN
C.LIBRARY:        XASGRAPH
C.AUTHOR:         L.Chiappetti - IFCTR Milano
C.VERSIONS:       0.0 - 13 Oct 93 - Prototype
C.PURPOSE:        plot a spectrum oas solid line
C.SYNTAX:         CALL PLOT_XY_JOIN(LUS,LOWER,UPPER,DATA,NCHAN,X,Y)
C.PARAMETERS:     INTEGER LUS(2)     : the graphics logical units
C                 REAL XAX           : the x data values
C                 REAL DATA          : the y data values
C                 INTEGER NCHAN      : number of points
C                 REAL X,Y           : work buffers (size at least 2*NCHAN)
C----------------------------------------------------------------------
C
        INTEGER NCHAN,I,LUS(*)
        REAL    XAX(*),DATA(*),X(*),Y(*)
        INCLUDE 'pencommon.inc'
C
C       plot as solid line the y-data in DATA
C       where the width of the bins is given in x by LOWER and UPPER
C       and NCHAN is the number of points
C       X and Y are work arrays
C       additionally does a Y-axis clipping for log scales !!!
C
          DO 300 I=1,NCHAN
            X(I)=XAX(I)
            Y(I)=DATA(I)
            if(pencommon_yclip)then
            y(i)=max(y(i),pencommon_ywl)
            endif
 300      CONTINUE
          CALL Y_COLOUR(LUS,PENCOMMON_DAT)
*         CALL Y_LINES(LUS,NCHAN,X,Y)
C-->      provisionally Y_LINES does not support > 512 points
C-->      do the break in chunks here
          DO 888 I=1,NCHAN,512
          CALL Y_LINES(LUS,MIN(512,  NCHAN-I+1),X(I),Y(I))
 888      CONTINUE
        RETURN
        END
