C Sample of PBG 100 subroutines

        REAL XTONE(2),YTONE(2),HORARR(4),XARR(12),YARR(12)
        LOGICAL FACYET,OFFYET
        DATA XTONE/1.5,2.5/,YTONE/0.1,1.1/
        DATA HORARR/0.2,0.4,0.6,0.8/
        DATA XARR/1085.,1523.,3321.,7154.,9912.,9329.,5133.,
     1 2513.,932.,265./
        DATA YARR/7.0,12.1,17.5,21.8,28.0,35.2,38.6,41.8,50.6,53.8/
        CALL PLOTS('HP7470')
        CALL PLOT(0.,0.,3)

C Draw a triangle in the upper left corner, and label it
1000    CALL PLOT(0.1,0.6,3)
        CALL PLOT(0.8,0.1,2)
        CALL PLOT(0.8,1.1,2)
        CALL PLOT(0.1,0.6,2)
        CALL SYMBOL(1.0,0.1,2,'Triangle',90.,8)

C Draw a rectangle with cross hatching
C XTONE and YTONE are defined in intro section
C Cross hatching will be at 30 and 135, .2 inches spacing
2000    CALL TONE(XTONE,YTONE,Z'42',.2)
        CALL SYMBOL(2.7,0.1,1,'A TONEd square',90.,14)

C Draw a pie section with cross hatching at 0 and 60,
C    .1 inch spacing
C Pie section is from 150 to 210 degrees
3000    ANG1=150.*3.1415926/180.
        ANG2=210.*3.1415926/180.
        CALL SHADE(4.,0.6,1.,ANG1,ANG2,Z'5',.1)
        CALL SYMBOL(4.2,0.1,1,'A SHADEd area',90.,13)

C Draw a square, then call FACTOR to see the difference
4000    CALL SYMBOL(0.2,1.5,1,'Before FACTOR',90.,13)
        FACYET=.FALSE.
4010    CALL PLOT(0.3,1.5,3)
        CALL PLOT(0.3,2.5,2)
        CALL PLOT(1.3,2.5,2)
        CALL PLOT(1.3,1.5,2)
        CALL PLOT(0.3,1.5,2)
        IF (FACYET) GO TO 4100
        CALL FACTOR(1.4)
        FACYET=.TRUE.
        GO TO 4010

4100    CALL FACTOR(1.0)
        CALL SYMBOL(2.0,2.15,1,'After FACTOR',90.,12)

C Draw a square, then call OFFSET to see the difference
5000    CALL SYMBOL(0.2,3.7,1,'Before OFFSET',90.,13)
        OFFYET=.FALSE.
5010    CALL PLOT(0.3,3.7,13)
        CALL PLOT(0.3,4.7,12)
        CALL PLOT(1.3,4.7,12)
        CALL PLOT(1.3,3.7,12)
        CALL PLOT(0.3,3.7,12)
        IF (OFFYET) GO TO 5100
C Set the X & Y offset to down and right one inch,
C   leave the X axis factoring the same, but expand the Y by 30%
        CALL OFFSET(-1.,1.,-1.,0.77)
        OFFYET=.TRUE.
        GO TO 5010

5100    CALL OFFSET(0.,1.,0.,1.)
        CALL SYMBOL(2.5,6.1,1,'After OFFSET',90.,12)

C Example of a solid grid with both fixed intervals and an array
C The array HORARR is defined above
C The vertical is broken into 3 segments of .4 inches each
6000    CALL GRID(3.7,1.4,3,0.4,1004,HORARR,Z'FFFF')
        CALL SYMBOL(3.9,1.4,2,'A Grid',90.,6)

C Example of WHERE and NUMBER
7000    CALL PLOT(5.,0.2,3)
        CALL WHERE(XCUR,YCUR,FACCUR)
        CALL PLOT(4.85,0.5,2)
        CALL PLOT(5.15,0.5,2)
        CALL PLOT(5.,0.2,2)
        CALL PLOT(5.,0.9,2)
        CALL SYMBOL(4.9,1.0,2,'XCUR YCUR  FACCUR',90.,17)
        CALL NUMBER(5.1,1.0,1,XCUR,90.,1)
        CALL NUMBER(5.1,1.7,1,YCUR,90.,1)
        CALL NUMBER(5.1,2.4,1,FACCUR,90.,1)

C Example of how to make a (small) graph
C Data is in XARR and YARR, 10 data elements
8000    CALL SCALE(XARR,2.0,10,-1)
        CALL SCALE(YARR,3.5,10,1)
        CALL AXIS(5.,4.3,'Output',6,2.0,180.0,XARR(11),XARR(12))
        CALL AXIS(5.,4.3,'Frequency in Hertz',-18,3.5,90.0,
     1    YARR(11),YARR(12))
        CALL LINE(XARR,YARR,10,1,Z'FFFF')

        CALL PLOT(0.,0.,-9999)
        END
