      SUBROUTINE BARTXT(XL,XR,YB,YT,IMAIN)                              BART001
C----------------------------------------------------------------------+BART002
C                                                                       BART003
C  SUBROUTINE BARTXT  -  Print the graph headings and other text items  BART004
C                                                                       BART005
C----------------------------------------------------------------------+BART006
                                                                        BART007
      INCLUDE 'bplot.inc'                                               BART008
                                                                        BART009
      INTEGER       ELEN, IMAIN, IPLANE, LLEN                           BART010
      LOGICAL       PLANE                                               BART011
      REAL          X1, X2, XC, XL, XR, YB, YT                          BART012
                                                                        BART013
                                                                        BART014
C---- Initialise plot positions                                         BART015
      IF (IMAIN.GT.NMAIN) THEN                                          BART016
          IPLANE = IMAIN - NMAIN                                        BART017
          PLANE = .TRUE.                                                BART018
      ELSE                                                              BART019
          PLANE = .FALSE.                                               BART020
      ENDIF                                                             BART021
      X1 = XL                                                           BART022
      X2 = XR                                                           BART023
      XC = (XL + XR) / 2.0                                              BART024
                                                                        BART025
C---- If this is a planar group, then plot appropriate heading          BART026
      IF (PLANE) THEN                                                   BART027
                                                                        BART028
C----     Plot the graph heading                                        BART029
          CALL PSCTXT(XC,YT + 8.0,8.0,PNAME(IPLANE))                    BART030
                                                                        BART031
C---- Otherwise, is a bond angle or length                              BART032
      ELSE                                                              BART033
                                                                        BART034
C----     Determine length of heading                                   BART035
          LLEN = INDEX(LENANG(IMAIN),' ') - 1                           BART036
          IF (LLEN.LE.0) LLEN = 1                                       BART037
                                                                        BART038
C----     Determine length of subheading                                BART039
          ELEN = 17                                                     BART040
 100      CONTINUE                                                      BART041
              ELEN = ELEN - 1                                           BART042
          IF (ELEN.GT.1 .AND. ENDESC(IMAIN)(ELEN:ELEN).EQ.' ') GO TO 100BART043
                                                                        BART044
C----     Plot the graph headings                                       BART045
          CALL PSCTXT(XC,YT + 16.0,10.0,LENANG(IMAIN)(1:LLEN))          BART046
          CALL PSCTXT(XC,YT + 8.0,8.0,ENDESC(IMAIN)(1:ELEN))            BART047
      ENDIF                                                             BART048
                                                                        BART049
C---- Plot y-axis heading                                               BART050
      CALL PSRCTX(XL - 20.0,(YB + YT) / 2.0,10.0,'Frequency')           BART051
                                                                        BART052
      RETURN                                                            BART053
      END                                                               BART054
