     	SUBROUTINE XYPLOT_PLOT
C
C  PROGRAMMER:  R.S. ZHOU
C		ALFRED UNIVERSITY
C
C	THIS ROUTINE CARRIES OUT THE PLOTTING FOR X,Y PLOT.
C
     	INCLUDE 'XYPLOT.CBS'
C
C  INITIALIZE THE CRT...
C
     	CALL IFANSI_VIDEO(47)
     	CALL IFINIT_LINE( 3 )
     	IF( INIT ) THEN
     	    CALL IFINIT_PLOT( XORG, YORG, DATNAM )
     	ELSE
     	    CALL IFINIT_PLOT( XORG, YORG, '$OVERLAY' )
     	ENDIF
     	IF( IFCTRL_C() ) GOTO 999
C
C  OPEN A GRAPHICS SEGMENT TO SAVE THE PLOT...
C
     	IF( .NOT.IFINIT_SAVE() ) RETURN
     	IF( .NOT.IF_DCL_HARDCOPY() ) WRITE(6,1)
  1	FORMAT('$Press CTRL/C to cancel plotting...')
     	CALL IFINIT_DIF(0)
     	CALL IFSCAL( XSCL, YSCL )
     	CALL IFINIT_DIF(1)
     	CALL IFROTA( XANG(1), XANG(2) )
C
C  DRAW GRAPH TITLE IF ANY...
C
     	IF( TITL(1).NE.' ' ) THEN
     	    CALL IFSPEN(1)
    	    XLEN = XLNS(1)
    	    IF(BAND.AND.XOFF.GT.0.0.AND.YOFF.EQ.0.0) XLEN=XOFF+XLNS(3)
     	    CALL IFTEXT_CENT(0.,XLEN,-1.,-1.,TITL(1),.15,.15)
     	ENDIF
C
C  DRAW THE AXES OF THE 1ST GRAPH BAND ...
C
     	IF( IFCTRL_C() ) GOTO 999
     	IF( XINC(1).EQ.0.0 .OR. XINC(2).EQ.0.0 ) THEN
     	    IF( .NOT.IF_DCL_HARDCOPY() ) THEN
     		CALL IFANSI_VIDEO(70)
     		WRITE(6,1000)
 1000		FORMAT(' oops: 1st graph band data scaling failure.')
     		GOTO 222
     	    ELSE
     	STOP '%XYPLOT_PLOT: 1st graph band data scaling failure.'
     	    ENDIF
     	ENDIF
     	CALL IFSPEN( COL1 ) 
     	IF( LAXS(1).GT.0 ) CALL XYPLOT_AXIS( 1 )
     	IF( IFCTRL_C() ) GOTO 999
     	IF( LAXS(2).GT.0 ) CALL XYPLOT_AXIS( 2 )
C
C  DRAW DATA SETS THAT BELONG TO THE 1ST GRAPH BAND...
C
     	IF( IFCTRL_C() ) GOTO 999
    	CALL XYPLOT_DRAW( 1 )
C
C  DRAW THE 2ND GRAPH BAND IF ANY...
C
  222	IF( IFCTRL_C() ) GOTO 999
     	IF( BAND ) THEN
     	    IF( XINC(3).EQ.0.0 .OR. XINC(4).EQ.0.0 ) THEN
     		IF( .NOT.IF_DCL_HARDCOPY() ) THEN
     		CALL IFANSI_VIDEO(70)
     		WRITE(6,2000)
 2000		FORMAT(' oops: 2nd graph band data scaling failure.')
     		GOTO 555
     		ELSE
     	STOP '%XYPLOT_PLOT: 2nd graph band data scaling failure.'
     		ENDIF
     	    ENDIF
     	    CALL IFROTA( XANG(3), XANG(4) )
     	    IF(XOFF.NE.0.0.OR.YOFF.NE.0.0) CALL IFPLOT(XOFF,YOFF,-3)
     	    CALL IFSPEN( COL2 )
     	    IF( LAXS(3).GT.0 ) CALL XYPLOT_AXIS( 3 )
     	IF( IFCTRL_C() ) GOTO 999
     	    IF( LAXS(4).GT.0 ) CALL XYPLOT_AXIS( 4 )
     	IF( IFCTRL_C() ) GOTO 999
    	    CALL XYPLOT_DRAW( 2 )
     	    IF(XOFF.NE.0.0.OR.YOFF.NE.0.0) CALL IFPLOT(-XOFF,-YOFF,-3)
     	    CALL IFROTA( XANG(1), XANG(2) )
     	ENDIF
C
C  CLOSE THE PLOT SESSION...
C
  555	CALL IFSTYL( 1, 1 )			!RESET PLOTTING STYLUS
     	IF( CRT.EQ.2 ) CALL IFSEG_OPEN( 0 ) 	!CLOSE THE SEGMENT
     	IF( IFCTRL_C() ) GOTO 999
    	IF( DESNAM.NE.' ' ) CALL LAYOUT_MAIN(0,XORG,YORG,DESNAM)
  999	CALL IFINIT_PLOT_END
     	RETURN
    	END

     	SUBROUTINE XYPLOT_AXIS( ICODE )
C
C	THIS ROUTINE PLOTS AN AXIS FOR X,Y PLOT.
C
     	INCLUDE 'XYPLOT.CBS'
C
C  GET TYPE OF AXIS TO PLOT...
C
     	ICD = ICODE
     	ITY = LAXS(ICD)
     	IF( ICD.EQ.2 .OR. ICD.EQ.4 ) ITY = 3 + ITY
C
C  OFFSET THE AXIS IF MULTI-QUADRANT PLOT OR 2ND BAND IS DESIRED...
C
     	XPS = 0.0
    	YPS = 0.0
    	IF( QUAD.EQ.1 ) THEN
     	    IF( ITY.LT.4 ) YPS = XYPLOT_CROSS(1)
     	    IF( ITY.GT.3 ) XPS = XYPLOT_CROSS(2)
     	ENDIF
     	IF( ICD.LT.3 ) THEN
     	    XLN = XLNS(1)
     	    YLN = XLNS(2)
     	ELSE
     	    XLN = XLNS(3)
     	    YLN = XLNS(4)
     	    IF( XOFF.EQ.0.0 .AND. YOFF.EQ.0.0 ) THEN
     		IF( ICD.EQ.3 ) YPS = YLN
     		IF( ICD.EQ.4 ) XPS = XLN
     	    ENDIF
     	ENDIF
     	IF( YPS.GT.0.5*YLN ) XLN = -XLN
     	IF( XPS.GT.0.5*XLN ) YLN = -YLN
     	NTICKS = NTKS(ICD)
     	IF( NTICKS.LT.0 ) THEN
     	    IF( ITY.LT.4 ) XLN = -XLN
     	    IF( ITY.GT.3 ) YLN = -YLN
     	    NTICKS = -NTICKS
     	ENDIF
C
C  DRAW THE AXIS...
C
     	XOF = 0.0
     	YOF = 0.0
     	IF( ITY.LT.4 ) THEN
     	    YOF = SOFF(ICD)
     	ELSE
     	    XOF = SOFF(ICD)
     	ENDIF
     	CALL IFPLOT( XPS+XOF, YPS+YOF, -3 )
     	JGDS = IGDS(ICD)
     	IF( IABS(JGDS).GT.10 ) THEN
     	    IF( ITY.LT.4 .AND. (YPS+YOF).NE.0.0 ) JGDS = JGDS/10
     	    IF( ITY.GT.3 .AND. (XPS+XOF).NE.0.0 ) JGDS = JGDS/10
     	    IF( BAND .AND. ICD.GT.2 .AND. IABS(JGDS).GT.10 ) THEN
     		IF( XOFF.EQ.0.0 .AND. YOFF.EQ.0.0 ) JGDS = JGDS/10
     	    ENDIF
     	    IGDS(ICD) = JGDS
     	ENDIF
     	CALL IFAXIS( ITY,XLN,YLN,TITL(ICD+1),XLOW(ICD),XINC(ICD),
     +  OFFS(ICD), NTICKS, MTKS(ICD), NDGS(ICD), JGDS )
     	CALL IFPLOT( -XPS-XOF, -YPS-YOF, -3 )

     	RETURN
	END

     	FUNCTION XYPLOT_CROSS( ICODE )
C
C	THIS ROUTINE CALCULATES X,Y AXIS ORIGIN INTERSECTION.
C
     	INCLUDE 'XYPLOT.CBS'

     	CALL XYPLOT_VINCH( 1, DELTAX, DELTAY )
     	XPS = 0.0
     	YPS = 0.0
     	X11 = ABS(XLOW(1)/DELTAX) + OFFS(1)
     	X22 = ABS(XHIG(1)/DELTAX) + OFFS(1)
     	XLN = XLNS(1) - OFFS(1)
     	IF( X11.LT.XLN .AND. X22.LT.XLN ) XPS = X11
     	X11 = ABS(XLOW(2)/DELTAY) + OFFS(2)
     	X22 = ABS(XHIG(2)/DELTAY) + OFFS(2)
     	XLN = XLNS(2) - OFFS(2)
     	IF( X11.LT.XLN .AND. X22.LT.XLN ) YPS = X11
     	IF( XPS.EQ.0.0 .AND. YPS.EQ.0.0 ) GOTO 999
     	IF( XPS.NE.0.0 .AND. YPS.NE.0.0 ) GOTO 999
     	IF( XPS.NE.0.0 ) THEN
     	    IF( ABS(XHIG(2)).LT.ABS(XLOW(2)) ) YPS = XLNS(2)
     	ELSE
     	    IF( ABS(XHIG(1)).LT.ABS(XLOW(1)) ) XPS = XLNS(1)
     	ENDIF

999	IF( ICODE.EQ.1 ) XYPLOT_CROSS = YPS
     	IF( ICODE.EQ.2 ) XYPLOT_CROSS = XPS

     	RETURN
     	END

    	SUBROUTINE XYPLOT_DRAW( ICODE )
C
C	THIS ROUTINE DRAWS THE DATA SETS.
C
C	ICODE=1: DRAW THE DATA SETS ON THE 1ST GRAPH BAND.
C	ICODE=2: DRAW THE DATA SETS ON THE 2ND GRAPH BAND.
C
    	INCLUDE	'XYPLOT.CBS'
     	COMMON/XYPLOT_DRAW/ XPOS, YPOS, LMAX
     	COMMON/GRAFIT_SCRATCH/ XDAT(MNP+3), YDAT(MNP+3), YBAR(MNP)
C
C  PLOT OFFSETS (1ST MAJOR TICKMARK OFFSETS) IF SPECIFIED...
C
     	ICD = ICODE
     	IF( ICD.EQ.1 ) THEN
     	    ITT = 2
     	    XOF = OFFS(1)
     	    YOF = OFFS(2)
     	    XPOS= XLPS - XOF + 0.15
    	    YPOS= YLPS - YOF + 0.15
     	    LMAX= 0
     	ELSE
     	    ITT = 1
     	    XOF = OFFS(3)
     	    YOF = OFFS(4)
     	    IF( XOFF.NE.0.0 .OR. YOFF.NE.0.0 ) THEN
     		XPOS = XLPS - XOF + 0.15
     		YPOS = YLPS - YOF + 0.15
     		LMAX= 0
     	    ENDIF
     	ENDIF
     	IF( XOF.GT.0.0 .OR. YOF.GT.0.0 ) CALL IFPLOT( XOF, YOF, -3 )
C
C  START DRAWING DATA SET BY SET...
C
     	OFFX = 0.0	!INDIVIDUAL DATA SET OFFSETS
     	OFFY = 0.0
     	IF(CRT.EQ.2) CALL IFFILL_PANEL(0)	!DISABLE FILL NEW-PANEL CHECK
    	DO  999 I = 1, NSET
     	IF( IFCTRL_C() ) RETURN
C
C  SKIP THE SET IF PEN_CODE=0 .OR. BAND_CODE=ITT ...
C
     	IF( IPEN(I).EQ.0 .OR. ISET(I).EQ.ITT ) GOTO 999
C
C  LOAD THE X,Y COORDINATES...
C
     	CALL XYPLOT_LOAD( ICD, I, NPTS )
C
C  SKIP IF THE ALL DATA POINTS ARE SCALED OUT OF PLOT WINDOW...
C
     	IF( NPTS.EQ.0 ) GOTO 999
C
C  OFFSETS THIS SET OF DATA IF SPECIFIED...
C
     	OFFX = OFFX + XSH(I)
     	OFFY = OFFY + YSH(I)
     	IF( OFFX.NE.0.0 .OR. OFFY.NE.0.0 ) CALL IFPLOT(OFFX,OFFY,-3)
C
C  SET THE DRAWING COLOR FOR THIS SET...
C
     	CALL IFSPEN( IPEN(I) )
C
C  DRAW THE DATA SET...
C
     	IF( ILIN(I).LT.0 ) NPTS = -NPTS
     	CALL IFSTYL( IABS(ILIN(I)), IBOL(I) )
     	IF( IFCTRL_C() ) RETURN
     	CALL IFLINE( ISYM(I), SSIZ(I), ISHD(I), NPTS, XDAT, YDAT )
     	IF( IFCTRL_C() ) RETURN
C
C  PLOT ERROR BARS IF ANY...
C
    	IF( NSDS.GT.0 .AND. LSET(2,I).EQ.1 ) THEN
     	    CALL XYPLOT_SBAR( ICD, I, IABS(NPTS) )
     	ENDIF
     	IF( OFFX.NE.0.0 .OR. OFFY.NE.0.0 ) CALL IFPLOT(-OFFX,-OFFY,-3)
C
C  DRAW THE SET ID LABEL...
C
    	IF( DRAW.GT.0 .AND. LABL(LSET(1,I)).NE.' ' ) THEN
    	    IF( ITT.NE.1 .OR. ISET(I).NE.3 ) CALL XYPLOT_DRAW_ID(I)
     	ENDIF
C
C  GET THE NEXT SET OF DATA...
C
  999	CONTINUE
C
C  RESET PLOTTING STYLUS...
C
     	CALL IFSTYL( 1, 1 )
     	IF(CRT.EQ.2) CALL IFFILL_PANEL(1)	!ENABLE FILL NEW-PANEL CHECK
C
C  RESTORE THE ORIGINS...
C
    	IF( XOF.GT.0.0.OR.YOF.GT.0.0 ) CALL IFPLOT(-XOF,-YOF,-3)
C
C  DRAW THE SET ID LABEL BOX IF SPECIFIED...
C
     	IF( IFCTRL_C() ) RETURN
     	IF( DRAW.EQ.2 .AND. LMAX.GT.0 ) CALL XYPLOT_DRAW_BOX(ICD)

    	RETURN
    	END

     	SUBROUTINE XYPLOT_LOAD(ICODE,KSET,NPTS)
C
C	THIS ROUTINE LOADS A SET OF DATA FOR PLOTTING.
C
C	KSET: DATA SET POINTER.
C	NPTS: NUMBER OF DATA POINTS LOADED.
C
     	INCLUDE	'XYPLOT.CBS'
     	COMMON/GRAFIT_SCRATCH/ XDAT(MNP+3), YDAT(MNP+3), YBAR(MNP)

     	ICD  = ICODE
     	IF( ICD.EQ.1 ) THEN
     	    LXX  = IABS(LAXS(1))
     	    LYY  = IABS(LAXS(2))
     	ELSE
     	    LXX  = IABS(LAXS(3))
     	    LYY  = IABS(LAXS(4))
     	ENDIF
     	CALL XYPLOT_LIMIT( ICD, X1, X2, Y1, Y2 )
     	NPTS = 0
     	IT1  = KSET
     	IT2  = LSET(1,IT1)
     	IT3  = LSET(2,IT1)
     	XSC  = XSF(IT1)
     	YSC  = YSF(IT1)
     	DO  I= 1, NUMS(IT2), IDEN(IT1)
    	    XIJ = XSC*X(I,IT2)
    	    YIJ = YSC*Y(I,IT2)
     	    IF( LXX.EQ.2 ) XIJ = LOG10( XIJ )
    	    IF( LXX.EQ.3 ) XIJ = 1.0/XIJ
    	    IF( LYY.EQ.2 ) YIJ = LOG10( YIJ )
    	    IF( LYY.EQ.3 ) YIJ = 1.0/YIJ
     	    IF( XIJ.GE.X1 .AND. XIJ.LE.X2 .AND. YIJ.GE.Y1 .AND.
     +          YIJ.LE.Y2 ) THEN
     		NPTS = NPTS + 1
     		XDAT(NPTS) = XIJ
     		YDAT(NPTS) = YIJ
     		IF(IT3.EQ.1) YBAR(NPTS) = YSC*Y(I,IT2+1)
     	    ENDIF
     	ENDDO
     	IF( NPTS.GT.0 ) THEN
     	    IF( ICD.EQ.1 ) THEN
     		XIJ = XLOW(1)
     		YIJ = XLOW(2)
     	    ELSE
     		XIJ = XLOW(3)
     		YIJ = XLOW(4)
     	    ENDIF
     	    IF( LXX.EQ.2 ) XIJ = LOG10( XIJ )
    	    IF( LXX.EQ.3 ) XIJ = 1.0/XIJ
    	    IF( LYY.EQ.2 ) YIJ = LOG10( YIJ )
    	    IF( LYY.EQ.3 ) YIJ = 1.0/YIJ
     	    XDAT(NPTS+1) = XIJ
     	    YDAT(NPTS+1) = YIJ
     	    CALL XYPLOT_VINCH( ICD, XDAT(NPTS+2), YDAT(NPTS+2) )
     	    IF( ISHD(IT1).NE.0 ) THEN	!PLOT REFERENCE LINE ON
     		YIJ = SRL(IT1)
     		IF( LYY.EQ.2 ) THEN
     		    IF( YIJ.LE.0.0 ) THEN
     			YIJ = Y1
     		    ELSE
     			YIJ = LOG10( YIJ )
     		    ENDIF
     		ENDIF
     		IF( LYY.EQ.3 ) THEN
     		    IF( YIJ.EQ.0.0 ) THEN
     			YIJ = Y1
     		    ELSE
     			YIJ = 1.0/YIJ
     		    ENDIF
     		ENDIF
     		YDAT(NPTS+3) = YIJ
     	    ENDIF
     	ENDIF

     	RETURN
     	END

     	SUBROUTINE XYPLOT_SBAR( ICD, KSET, NPTS )
C
C	THIS ROUTINE DRAWS THE ERROR BARS FOR X,Y PLOT.
C
     	INCLUDE 'XYPLOT.CBS'
     	COMMON/GRAFIT_SCRATCH/ XDAT(MNP+3), YDAT(MNP+3), YBAR(MNP)

     	NP = NPTS
     	IT = ICD
     	IF( IT.EQ.1 ) LY = IABS(LAXS(2))
     	IF( IT.EQ.2 ) LY = IABS(LAXS(4))
     	XLO = XDAT(NP+1)
     	XDL = 1.0/XDAT(NP+2)
     	YLO = YDAT(NP+1)
     	YDL = 1.0/YDAT(NP+2)
     	SIZ = SSIZ(KSET)
     	IF( ISYM(KSET).EQ.0 ) SIZ = 0.0
    	DO 999 I= 1, NP
     	IF( IFCTRL_C() ) RETURN
    	    YBR = ABS(YBAR(I))
    	    IF( YBR.EQ.0.0 ) GOTO 999
     	    YPT = YDAT(I)
     	    YBR = NSDS*YBR
    	    IF( LY.EQ.1 ) THEN
     		YTP = YDL*(YPT+YBR-YLO)
     		YBB = YDL*(YPT-YBR-YLO)
    	    ENDIF
    	    IF( LY.EQ.2 ) THEN
     		YTP = YDL*(LOG10(10.0**YPT+YBR)-YLO)
     		YBB = YDL*(LOG10(10.0**YPT-YBR)-YLO)
    	    ENDIF
    	    IF( LY.EQ.3 ) THEN
     		YTP = YDL*(1.0/(1.0/YPT+YBR)-YLO)
     		YBB = YDL*(1.0/(1.0/YPT-YBR)-YLO)
    	    ENDIF
     	    IF( (YTP-YBB).LE.SIZ ) GOTO 999	!TOO SHORT TO DRAW
     	    XXX = XDL*(XDAT(I)-XLO)
     	    XBL = XXX - 0.025
     	    XBR = XXX + 0.025
    	    CALL IFPLOT(XBL,YTP,3)
    	    CALL IFPLOT(XBR,YTP,2)
    	    CALL IFPLOT(XXX,YTP,3)
     	    IF( SIZ.GT.0.0 ) THEN		!BYPASS THE SYMBOL
     		YBR = YDL*(YPT-YLO)
     		CALL IFPLOT(XXX,YBR+0.5*SIZ,2)
     		CALL IFPLOT(XXX,YBR-0.5*SIZ,3)
     	    ENDIF
   	    CALL IFPLOT(XXX,YBB,2)
    	    CALL IFPLOT(XBL,YBB,3)
    	    CALL IFPLOT(XBR,YBB,2)
999	CONTINUE

     	RETURN
     	END

     	SUBROUTINE XYPLOT_DRAW_ID( KSET )
C
C 	THIS ROUTINE DRAWS THE DATA SET LABELS.
C
     	INCLUDE 'XYPLOT.CBS'
     	COMMON/XYPLOT_DRAW/ XPOS, YPOS, LMAX

     	ITT = KSET
     	XPS = XPOS
     	YPS = YPOS
     	YIN = 0.25
     	IF( MARK.EQ.0 ) GOTO 222		!SKIP THE MARKER
C
C  DRAW THE PREFIX-MARKER...
C
     	IFL = IABS(ISHD(ITT))
     	ISM = ISYM(ITT)
     	SIZ = SSIZ(ITT)
     	IF( SIZ.GT.0.4 ) SIZ = 0.4
     	IF( SIZ.GT.0.1 ) THEN
     	    YPS = YPS + 0.5*SIZ
     	    YIN = SIZ + 0.15
     	ELSE
     	    YPS = YPS + 0.05
     	ENDIF
     	IF( IFL.EQ.0 .OR. IFL.EQ.2 ) THEN	!NORMAL/STICK PLOT
     	    IF( ISM.EQ.0 ) THEN
     		CALL IFPLOT( XPS, YPS, 3 )
     		CALL IFPLOT( XPS+0.6, YPS, 2 )
     	    ELSE
     		IF( ISM.GT.0 ) THEN
     		    CALL IFPLOT( XPS, YPS, 3 )
     		    CALL IFPLOT( XPS+0.3-0.5*SIZ, YPS, 2 )
     		ENDIF
     		CALL IFMARK( XPS+0.3, YPS, SIZ, 0.0, IABS(ISM) )
     		IF( ISM.GT.0 ) THEN
     		    CALL IFPLOT( XPS+0.3+0.5*SIZ, YPS, 3 )
     		    CALL IFPLOT( XPS+0.6, YPS, 2 )
     		ENDIF
     	    ENDIF
     	ENDIF
     	IF( IFL.EQ.3 ) THEN		!BAR PLOT
     	    IF( ISM.NE.0 ) CALL IFFILL( IABS(ISM) )
     	    CALL IFBARS( XPS+0.3, YPS, 0.6, SIZ, 0.0, 0.0 )
     	    IF( ISM.NE.0 ) CALL IFFILL( 0 )
     	ENDIF
     	IF( IFL.EQ.1 ) THEN		!AREA FILL
     	    IF( ISM.EQ.0 ) ISM = 1
     	    CALL IFFILL( ISM )
     	    CALL IFBARS( XPS+0.3, YPS, 0.6, SIZ, 0.0, 0.0 )
     	    CALL IFFILL(  0  )
     	ENDIF
     	YPS = YPS - 0.05
     	XPS = XPS + 0.7
C
C  DRAW THE ID LABEL...
C
222	IFL = IFMISC_LENG( LABL(LSET(1,ITT)) )
     	IF( IFL.GT.LMAX ) LMAX = IFL
     	CALL IFTEXT_EXT(XPS,YPS,LABL(LSET(1,ITT)),0.1,0.1,0.0)
     	YPOS = YPOS + YIN

     	RETURN
     	END

     	SUBROUTINE XYPLOT_DRAW_BOX(ICODE)
C
C	THIS ROUTINE DRAWS THE BOX AROUND SET ID LABELS.
C
     	INCLUDE 'XYPLOT.CBS'
     	COMMON/XYPLOT_DRAW/ XPOS, YPOS, LMAX

     	ICD = ICODE
     	ITT = 0
     	IF( .NOT.BAND ) THEN
     	    ITT = 2
     	ELSE
     	    IF( ICD.EQ.1 ) THEN
     		IF( XOFF.NE.0.0 .OR. YOFF.NE.0.0 ) ITT = 2
     	    ELSE
     		ITT = 4
     		IF( XOFF.EQ.0.0 .AND. YOFF.EQ.0.0 ) ITT = 2
     	    ENDIF
     	ENDIF
     	IF( ITT.GT.0 ) THEN
     	    IF( CRT.EQ.2 ) XPOS = XLPS + 1.0 + 0.10*LMAX
     	    IF( CRT.EQ.3 ) XPOS = XLPS + 1.0 + 0.14*LMAX
     	    IF( MARK.EQ.0 ) XPOS = XPOS - 0.7
     	    YPOS = YPOS + OFFS(ITT)
     	    IF( ITT.EQ.2 ) CALL IFSPEN(COL1)
     	    IF( ITT.EQ.4 ) CALL IFSPEN(COL2)
     	    CALL IFPLOT( XLPS, YLPS, 3 )
     	    CALL IFPLOT( XLPS, YPOS, 2 )
     	    CALL IFPLOT( XPOS, YPOS, 2 )
     	    CALL IFPLOT( XPOS, YLPS, 2 )
     	    CALL IFPLOT( XLPS, YLPS, 2 )
     	ENDIF

     	RETURN
     	END

