SUBROUTINE PLOT_XXY_JOIN(LUS,LOWER,UPPER,DATA,NCHAN,X,Y) C C---------------------------------------------------------------------- C.IDENTIFICATION: Subroutine PLOT_XXY_JOIN C.LIBRARY: XASGRAPH C.AUTHOR: L.Chiappetti - IFCTR Milano C.VERSIONS: 0.0 - 13 Oct 93 - Prototype C 0.1 - 16 Dec 96 - handles correctly gaps C 0.2 - 12 Nov 98 - handles backward jumps as gaps C.PURPOSE: plot a spectrum as solid line C.SYNTAX: CALL PLOT_XXY_HISTO(LUS,LOWER,UPPER,DATA,NCHAN,X,Y) C.PARAMETERS: INTEGER LUS(2) : the graphics logical units C REAL LOWER UPPER : the x lower and upper bin extrema 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,J,N1,N2,LUS(*) REAL LOWER(*),UPPER(*),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 a GAP is declared if LOWER(i) is not equal to UPPER(i-1) C within a tolerance of one percent of the previous bin size C I=0 N1=1 100 CONTINUE I=I+1 X(I)=(LOWER(I)+UPPER(I))/2. Y(I)=DATA(I) if(pencommon_yclip)then y(i)=max(y(i),pencommon_ywl) endif IF(I.EQ.1)GOTO 100 * IF(I.LT.NCHAN.AND.LOWER(I).EQ.UPPER(I-1))GOTO 100 * IF(I.LT.NCHAN.AND.LOWER(I)-UPPER(I-1) IF(I.LT.NCHAN.AND.ABS(LOWER(I)-UPPER(I-1)) . .LE.0.01*(UPPER(I-1)-LOWER(I-1)))GOTO 100 C C plot all points between start and end of current interval C where interval is bounded by a gap, or the start or end of file N2=I-1 IF(I.EQ.NCHAN)N2=NCHAN 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 J=N1,N2,512 CALL Y_LINES(LUS,MIN(512, N2-J+1),X(J),Y(J)) 888 CONTINUE C C and loop back IF(I.LT.NCHAN)THEN N1=I GOTO 100 ENDIF RETURN END