BGRAPH(1)                                                            BGRAPH(1)



NNAAMMEE
       bgraph - do a set of batch graphs to a metafile

SSYYNNOOPPSSIISS
       bbggrraapphh [ --ttyyppee ....  ][ ++vvaarriiaabbllee vvaalluuee ....  ][ ffiillee ....  ]

DDEESSCCRRIIPPTTIIOONN
       _B_g_r_a_p_h  reads  each  graph  _f_i_l_e  in sequence and converts it to a plot
       suitable for use by a metafile driver program.  If no files are  given,
       the standard input is read.

       The  graph  type  can be defined with a _-_t_y_p_e option.  Types are simply
       include files which set default  values  for  certain  variables.   The
       actual include file name is the type concatanated with ".plt".  Typical
       types are "scatter", "line", and "curve".  A scatter graph  shows  only
       points.   A  line  graph  shows  only lines connecting points.  A curve
       graph shows both points and connecting lines.

       Variables can be set explicitly with _+_v_a_r_i_a_b_l_e _v_a_l_u_e options.  The fol-
       lowing standard graph variables are supported:

       fftthhiicckk    The  frame thickness, valued from 0 to 4.  A value of 0 turns
                 the frame off.

       ggrriidd      The grid: 1 is on, 0 is off.

       iinncclluuddee   The include file name.  Graph input is taken from  the  file.
                 If  the  file  is  not  found in the current directory, it is
                 searched for in a set of standard locations.

       lleeggeenndd    The legend title.

       ootthhiicckk    The origin axis thickness, valued from 0 to 4.  A value of  0
                 turns the origin off.

       ppeerriioodd    The period for a polar plot.  For a plot in degrees, use 360.
                 For radians, use 6.283.  A value of 0 (the default) indicates
                 a Cartesian plot.

       ssuubbttiittllee  The graph subtitle.

       ssyymmffiillee   The point symbol metafile.

       ttssttyyllee    The  frame tick mark style.  The default value is 1, which is
                 outward tick marks.  A value of 2 is inward ticks, 3 is cross
                 ticks.  A value of 0 disables frame tick marks.

       ttiittllee     The graph title.

       xxllaabbeell    The x axis label.

       xxmmaapp      The   x   axis   mapping   function.    An   x  axis  mapping
                 xmap(x)=log(x) produces a log x axis.

       xxmmaaxx      The x axis maximum.

       xxmmiinn      The x axis minimum.

       xxsstteepp     The x axis step.

       yyllaabbeell    The y axis label.

       yymmaapp      The  y  axis   mapping   function.    An   y   axis   mapping
                 ymap(y)=log(y) produces a log y axis.

       yymmaaxx      The y axis maximum.

       yymmiinn      The y axis minimum.

       yysstteepp     The y axis step.

       In  addition  to  the standard graph variables, each curve has a set of
       variables.  The variables for curve 'A' all begin with the letter  'A';
       the  variables  for curve 'B' all begin with the letter 'B', and so on.
       Up to 8 curves are supported on a single graph, 'A' through  'H'.   The
       variables for curve 'A' are:

       AA         The  function  for  curve  'A'.  If _A_d_a_t_a is undefined, _x_m_i_n_,
                 _x_m_a_x and _A_n_p_o_i_n_t_s are used to determine  which  x  values  to
                 plot.   If  _A_d_a_t_a  is defined and _A is a function of a single
                 variable (ie. A(x)), data values are interpreted as x  values
                 to  be  plotted.   If _A_d_a_t_a is defined and _A is a function of
                 two variables (ie. A(x,y)), data values  are  interpreted  as
                 (x,y) pairs and _A becomes a mapping function for the data.

       AAccoolloorr    The  color  for  curve  A.  The values 1-4 map to black, red,
                 green, and blue respectively.  A value of  0  turns  curve  A
                 off.

       AAddaattaa     The point data for curve 'A'.  If _A_d_a_t_a is set to the name of
                 a file, data is read and  interpreted  from  that  file.   If
                 _A_d_a_t_a  is  set  to  a command (beginning with an exclamation,
                 '!'), the output of the command is read as data.   Otherwise,
                 data  is  read  from the current file.  Data values are sepa-
                 rated by white space and/or commas.  A semicolon  or  end  of
                 file indicates the end of data.

       AAllaabbeell    The  label  for curve 'A'.  The curve label is printed in the
                 legend when a curve is defined.

       AAlliinnttyyppee  The line type for curve 'A', valued from 0 to 4.  A value  of
                 0  turns  line  drawing  off.   A  value  of 1 is solid, 2 is
                 dashed, 3 is dotted, and 4 is dot-dashed.

       AAnnppooiinnttss  The number of symbol points  for  curve  'A'.   If  _A_d_a_t_a  is
                 defined, all points will be connected with the selected curve
                 line, but only _A_n_p_o_i_n_t_s points will be indicated with a  sym-
                 bol.   This prevents messy graphs when large number of points
                 are defined.  If _A is defined and _A_d_a_t_a is not,  _A_n_p_o_i_n_t_s  is
                 used  along with _x_m_i_n and _x_m_a_x to determine which x values to
                 plot.

       AAssyymmssiizzee  The symbol radius for curve 'A'.  The default size is 100.  A
                 value of 0 turns symbols off.

       AAssyymmttyyppee  This  is  the  name of a segment in _s_y_m_f_i_l_e which defines the
                 graphics symbol for curve 'A'.

       AAtthhiicckk    The line thickness for curve 'A', valued  from  0  to  4.   A
                 thickness of 0 turns line drawing off.

GGRRAAPPHH FFIILLEE FFOORRMMAATT
       A graph file contains definitions for graph and curve variables.  These
       definitions fall one per line in the following formats:

            vreal        = expression       # real variable
            vfunction(x) = expression(x)    # function
            vstring      = "string"         # string variable
            vdata        = filename         # data file
            vdata        = "!command"       # data generator
            variable     = continued \
                    line                    # newline escaped
            vdata        =                  # data
                 v1 v2 v3 v4 ... ;

       Comments are preceded by a '#', and continue to the end  of  the  line.
       Except for comments, the newline can be escaped with a backslash.  Note
       that in the special case where data is contained in the graph  file,  a
       definition  will  continue over more than one line.  Data values can be
       separated by commas or white space, and reading continues until a semi-
       colon  is  reached.   No  comments are allowed in the data section of a
       file.

       An expression is an algebraic formula  containing  numbers,  variables,
       functions,  and  the standard operators {+,-,*,/,^,(,)} (see icalc(1)).
       Besides the variables described in the  last  section,  definitions  of
       intermediate  real variables and functions are allowed for convenience.
       They may be used in expressions of graph and curve variables.

EEXXAAMMPPLLEE
       A file to graph the sine function is:

            title = "Sine Function from 0 to Pi"
            PI = 3.141592653589793
            A(x) = sin(x)
            xmin = 0
            xmax = PI
            Anpoints = 100

       Or, to graph selected points:

            title = "Sine Function at 0, .2, .6, and .8"
            A(x) = sin(x)
            Adata =
                 0 , .2
                 .6 , .8
            ;

       The commands to plot these files might be:

            bgraph -line sine1.plt | psmeta | lpr

            bgraph -curve +ymin -1 +ymax 1 sine2.plt | x11meta


FFIILLEESS
       /usr/local/lib/meta/*.mta /usr/local/lib/meta/*.plt *.plt

AAUUTTHHOORR
       Greg Ward

BBUUGGSS
       There is no mechanism provided for undefining a variable.  An axis map-
       ping  function  which  is  not  invertible (monotonically increasing or
       decreasing) confuses the program terribly.

SSEEEE AALLSSOO
       dgraph(1), gcomp(1), icalc(1), igraph(1), metafile(5), x11meta(1)



RADIANCE                            6/24/98                          BGRAPH(1)
