C  THIS IS A SIMPLE PROGRAM TO DEMONSTRATE SEVERAL OF THE COMMON
C  CHARACTER AND LINE PLOTTING METHODS AND THE SCALING OF THE PLOT
C  TO AN ARBITRARY OBJECT TIME SELECTED PLOTTER. THE RESULTING
C  PLOT FOLLOWS THE PROGRAM LISTING
      DIMENSION XD(2),YD(2),XS(4),YS(4),XX(50),Y(50),ISL(5),IS(10)
      DATA ISL/1,4*0/
      DATA XD,YD/0.,6.2831853,-1.,1./
      DATA XS,YS/2*0.,1.,3*0.,1.,0./
C
C  REQUEST PLOTTER NUMBER
      WRITE (*,10)
   10 FORMAT(' PLOTTER NUMBER: '$)
      READ (*,*) IPLOTR
C
C  INITIALIZE THE PLOTTER AND GET BOARD SIZE
      CALL PLTSET(IPLOTR,XBD,YBD,ISL)
C
C  RELATIVE SCALING
      XS(4)=AMIN1(10.,XBD)
      YS(4)=AMIN1(10.,YBD)
      XS(1)=XS(4)-1.1
      YS(1)=YS(4)-1.1
C
C  SCALE THE PLOT
      CALL SCALE(XD,YD,XS,YS,4,ICODE)
C
C  CHECK FOR ERROR
      IF (ICODE.NE.0) GO TO 40
C
C  DRAW A NEATLINE AROUND DATA AREA
      CALL NEATL
C
C  CREATE ARRAY OF SINE VALUES
      DO 30 J=1,50
      XX(J)=FLOAT(J-1)*.128
C
C  EXAMPLE OF CONTINUED LINE CALL
C  TO PLOT COSINE VALUES
      CALL LINE(XX(J),COS(XX(J)),1,1,401)
   30 Y(J)=SIN(XX(J))
C
C  PLOT SINE VALUES
      CALL LINE(XX,Y,50,0,200)
C
C  PLOT A DIAMOND AT SINE VALUE LOCATIONS
      CALL VCHAR(XX,Y,2,50,301,.08,0.,0.,0.)
C
C  LABEL AXES AFTER CENTERING THE TITLES FOR THE AXES
      CALL XAXIS(XD,YD,XS,.2,5,.09,'(F4.1)',4)
      CALL YAXIS(YD,XD,YS,.1,10,.09,'(F4.1)',4)
      CALL VCHAR((XD(1)+XD(2))*.5,YD(1),'VALUE'
     1 ,5,602,.12,0.,-.3,-.5)
      CALL VCHAR(XD,(YD(1)+YD(2))*.5,'AMPLITUDE'
     1 ,9,102,.12,1.5706,-.54,.5)
      CALL VCHAR(1.,.1,'PLOT EXAMPLE 1',14,507,.15
     1 ,0.,0.,.2)
C
C  DONE WITH THIS PLOT
C  IF VIDEO MODE HAS CHANGES, RETURN TO VIDEO MODE 2
C  GENERATE PLOT INFORMATION
C
      IS(1)=10
      IS(2)=2
      CALL ENDPT(IS)
      WRITE(6,100) (IS(I),I=2,10)
  100 FORMAT(' PLOT SUMMARY: ',/,
     1       '    ERRORS GENERATED     = ',I10,/,
     2       '    PLOT ROUTINE CALLS   = ',I10,/,
     3       '    CALLS TO VCHAR       = ',I10,/,
     4       '    CHARACTERS PLOTTED   = ',I10,/,
     5       '    CALLS TO LINE        = ',I10,/,
     6       '    LINE SEGMENTS DRAWN  = ',I10,/,
     7       '    BLOCKS WRITTEN       = ',I10,/,
     8       '    PLOT X-RASTERS       = ',I10,/,
     9       '    PLOT Y-RASTERS       = ',I10,/)
      GO TO 60
   40 PRINT 50
   50 FORMAT(' CANNOT SCALE')
   60 STOP
      END
