PRAG(1)                                                 PRAG(1)



NAME
       prag - compile diagrams for pic

SYNOPSIS
       prag [ filename ...  ]

DESCRIPTION
       .G1 [ width [ height ]]
       .G2
              prag  recognizes  its  input only between .G1 and
              .G2.  All other lines are copied literal to stan-
              dard output.  Two optional arguments to .G1 spec-
              ify the width and the height.
       # comment
              Lines starting with a hash mark '#'  are  treated
              as comments.
       draw line-style
              The  draw statement sets the line style for draw-
              ing the graphs.  Valid  arguments  are  the  line
              styles  as  known from pic(1) or the pseudo-style
              marked.  marked will yield a solid graph with the
              data  points  marked.  Up to five default marking
              characters (\(bu , \(*D , \(pl +, \(sq [],  \(mu
              )  are  used  for the first five graphs.  If you
              don't like these  characters,  you  can  override
              them by giving an additional drawing character to
              each data point (as second  or  third  argument).
              Use  line  style  invis  to draw unconnected data
              points.
       new [ line-style ] name [ label-string ]]]
              This statement switches a new graph within a dia-
              gram.   The  line  style  of  the graph is set to
              line-style.  The graph gets the name name,  which
              can  be referred in subsequent pic statements and
              is labeled with the string label-string.   label-
              string can be any valid pic string.
       label [ left | right | top | bot ] label-string
              label-string  is  placed at the specified side of
              the whole diagram.
       ticks [ left | right | top | bot ] [  where  ]  position
       ...
              Tick  marks  for the specified side are placed at
              the given positions.  where  says  to  place  the
              ticks inside (in) or outside (out) the diagram.
       ticks  [ left | right | top | bot ] [ where ] from begin
       to end [ by step ]
              This second variant of the tick-statement  allows
              the  automatic  generation  of ticks in the range
              from begin to end with an optional distance step.
       frame frame-attributes ...
              The  frame-attributes  are given to the box, that
              builds the frame of the diagram.  Valid  pic  box
              attributes can be used.  The internal name of the
              diagram frame is FRAME and of the surrounding box
              GRAPH.  Both can be used in pic statements to get
              special effects.  The boxes for  the  top,  left,
              right  and  bottom margin are TMARG, LMARG, RMARG
              and BMARG.
       spline
       nospline
              spline forces prag to  use  splines  for  drawing
              graphs,  which is the default.  nospline will use
              pic's line directives respectively.
       range xmin ymin xmax ymax
              Graphs are drawn within the range specified.
       ht number
              Sets the height of the diagram to number.
       wid number
              Sets the width of the diagram to number.
       grid [ line-style ]
              Draws a grid of line-style, dotted per default.
       pic { anything }
              Anything is passed literally through pic.
       next [ graph-name ] [ at ] position
              Sets a new data point for graph graph-name or the
              current graph at position position.
       position
              Position  is  described by an y coordinate and an
              optional x coordinate.  If the  x  coordinate  is
              missing, then x is assumed to be 0, 1, 2, 3, etc.
       position drawing-char
              For each data point an  optional  (as  second  or
              third  argument  respectively)  drawing character
              can be declared.  Any troff and eqn character  or
              special  character  or sequence of characters can
              be used.

EXAMPLES
   Example 1

              frame invis
              pic { line from FRAME.sw to FRAME.se }
              pic { line from FRAME.sw to FRAME.nw }
              draw invis
              0 \&
              2.9 NY
              7.8 NJ
              3.4 CA
              1.8 MI
              3.7 FL
       will produce:
        |
        |
        |
      8-|
        |             NJ
        |
      6-|
        |
        |
      4-|
        |                     CA              FL
        |      NY
       -|
      2 |                             MI
        |
        +-------+------+-------+-------+--------
       
               1       2       3      4
   Example 2

              wid 4
              ht 3
              grid dotted
              label left "execution" "time / sec"
              label bot "# of msgs"
              range 0 0 5000 25
              ticks left 0 5 10 15 20 25
              ticks right 0 5 10 15 20 25
              ticks top 0 1000 2000 3000 4000 5000
              ticks bot 0 1000 2000 3000 4000 5000
              new marked MSG "\s-2MSG\s+2" above
              100 0.19 \(*D
              ...
              next TLITCP at 5000 20.09 \(mu
              3000 18.08 \(mu
              4000 19.12 \(mu
       will produce:
                   0|     1000    2000   3000    4000    5000
                25 -        +       +      +       +       - 25
                            +       +      +       +       
                            +       +      +       +      []
                20 -+++++++++++++++++++++++++++++++++++++++ 20
                            +       +TLITCP+       
                            +      +            []
                         +       +      +       +
                15 -+++++++++++++++++++++++++++++++++++++++ 15
                            +       SOCKUD[]       +
      execution             +       +      +       +
     time / sec 10 -+++++++++++++++++TLIUDP+++++++++++++++++ 10
                            +      []      +       +
                            +       +      +       +
                            +       +      +       +
                 5 -+++++++[]+++++++++++++++++++++++++++++++ 5
                           +       + MSG  +       +
                       []   +       +      +       +
                 0 -[]      +       +      +       +       + 0
                   0      1000    2000   3000    4000    5000



                                # of msgs

   Example 3

              grid dotted
              draw marked
              100 0.19
              ...
              5000 3.69
              new marked
              0 0
              400 0.45
              ...
              5000 3.5
       will produce:
                +      +       +       +
                +      +       +       +
                +      +       +       +
      4-++++++++++++++++++++++++++++++++++++++++
                +      +       +       +      
                +      +       +       +
      3-++++++++++++++++++++++++++++++++++++++++
                +      +       +      +
                +      +       +       +
      2-+++++++++++++++++++++++++++++++++++++++
                +      +       +       +
                +             +       +
       -++++++++++++++++++++++++++++++++++++++++
      1        +      +       +       +
               +      +       +       +
               +      +       +       +

              1000   2000    3000    4000

   Example 4

              label left "execution time" "seconds"
              label right "\(ua message size"
              label bot "messages sent"
              range 0 0 10000 25
              ticks left 0 5 10 15 20 25
              ticks bot 0 1000 5000 10000
              100  1.3
              ...
              10000     24.6
       will produce:
           25  +

           20  +

           15  +
  execution time
      secon10  +                       message size

            5  +

            0  + +         +           +
              01000      5000       10000
                    messages sent

   Example 5

              label bot "time (in seconds)"
              label left "memory" "available"
              range 0 0 365 1800
              ticks left 200 400 600 800 1000 1200 1400 1600
              ticks bot 40 80 120 160 200 240 280 320 360
              new
              0 141
              ...
              365 1309
              new dashed
              nospline
              0 12
              150 247
              ...
              new dashed
              nospline
              210 824
              360 1508
       will produce:

           1600 -                           +
                                           + ++
           1400 -                        ++++
           1200 -                       +++
           1000 -                     ++
                                  +++++
       memor800 -                   ++
     availab600 -                  +
            400 -                ++++
                             +++++
            200 -    +++++++++  +
                 ++++   ++ +  +  +   +  +  +   +
                   40  80120 160200240280 320360

                     time (in seconds)

   Example 6

              draw invis
              1896 54.2
              1900 49.4
              ...
              1988 43.8
       will produce:

        

     52-

             
     49-  
                
                
     46-               
                      
                                  
       -                                    
     43                               

                +      +       +       +

              1914   1933    1952    1971

   Example 6

              40 72
              45 76
              ...
              65 79
       will produce:



     86-


     82-


     78-


       -
     74

                +      +       +       +

               45     50      55      60

SEE ALSO
       AT&T Bell Laboratories, Computing Science Technical
       Report No. 116, GRAP - A Graphics Language for Typeset-
       ting.  This can be obtained by sending a mail message to
       netlib@research.att.com with a body of
       `send 116 from research/cstr'.

BUGS
       Bug reports or suggested improvements should go to
       hm@GUUG.de.

AUTHOR
       This program was contributed by Holger Meyer at Univer-
       sity of Rostock, Germany.  It is available via anonymous
       ftp from ftp.informatik.uni-rostock.de in the directory
       /pub/local/software.



                         1 August 1993                  PRAG(1)
