# Appendix B: Examples

## B.7 Legends

                PROGRAM EXA_7
          C     USE DISLIN         for Fortran 90!
                PARAMETER(N=301)
                DIMENSION XRAY(N),Y1RAY(N),Y2RAY(N)
                CHARACTER*14 CBUF

                FPI=3.1415926/180.
                STEP=360./(N-1)
                DO I=1,N
                  XRAY(I)=(I-1)*STEP
                  X=XRAY(I)*FPI
                  Y1RAY(I)=SIN(X)
                  Y2RAY(I)=COS(X)
                END DO

                CALL DISINI
                CALL PAGERA
                CALL COMPLX
                CALL AXSPOS(450,1800)
                CALL AXSLEN(2200,1200)

                CALL NAME('X-axis','X')
                CALL NAME('Y-axis','Y')
                CALL TITLIN('Demonstration of CURVE',1)
                CALL TITLIN('Legend',3)
                CALL LABDIG(-1,'X')
                CALL TICKS(10,'XY')

                CALL GRAF(0.,360.,0.,90.,-1.,1.,-1.,0.5)
                CALL TITLE
                CALL XAXGIT

                CALL CHNCRV('LINE')
                CALL CURVE(XRAY,Y1RAY,N)
                CALL CURVE(XRAY,Y2RAY,N)

                CALL LEGINI(CBUF,2,7)          ! Legend statements
                NX=NXPOSN(190.)
                NY=NYPOSN(0.75)
                CALL LEGPOS(NX,NY)
                CALL LEGLIN(CBUF,'sin (x)',1)
                CALL LEGLIN(CBUF,'cos (x)',2)
                CALL LEGTIT('Legend')
                CALL LEGEND(CBUF,3)

                CALL DISFIN
                END

Figure B.7: Legends

Next | Previous | Contents